Some time back I remember, somebody posted an article on Popularity Calculation on CP that I'm not able to find using the CP's search engine X|. Can anyone point me to that article please?
gUrM33T
Posts
-
Popularity Calculation -
Multiple InclusionAny COM expert here? Please help! Gurmeet
BTW, can Google help me search my lost pajamas?
My Articles: HTML Reader C++ Class Library, Numeric Edit Control
-
Multiple InclusionI've a MTS/COM+ component (COMPONENT_1) that
#import
s ADO library. And, I have another MTS/COM+ component (COMPONENT_2) that#import
s this component (i.e. COMPONENT_1). I need to use ADO objects in my second component (COMPONENT_2) too. If I use#import
in my second component, I get lots of errors. If I do not, the MIDL compiler remains unable to recognize_Recordset
data type. Or, lets say that I do not use ADO in my second component at all i.e. I useIDispatch
instead of_Recordset
pointers to receive recordsets. This solves the problem but gives birth to a new problem. ADO recordsets loose their current position i.e. it moves to the first record if type casted toIDispatch
pointers. I dont know why. Can anyone please show me how to do it? I am using ATL with Visual C++ 6.0 SP5. Thanks Gurmeet
BTW, can Google help me search my lost pajamas?
My Articles: HTML Reader C++ Class Library, Numeric Edit Control
-
MSDataShape ErrorSHAPE {EXEC sp_S_Events} APPEND ({SELECT * FROM attendees WHERE event_id=?} RELATE event_id TO PARAMETER 0) AS rsAttendees
From a method (namely, GetEvents) of my COM+ business layer component (written in Visual C++ 6.0 SP5), I am issuing the statement given above but it fails with an error saying: Error 0x80004005: The data provider or other service returned an E_FAIL status. However, the same statement works perfectly fine when executed from within a program of Visual Basic. A small portion of code from my COM+ component is given below:STDMETHODIMP CBizLayer::GetEvents(/*[in]*/ long EventID, /*[out, retval]*/ VARIANT *pDataset) {
_ConnectionPtr spConn;
_RecordsetPtr spDataset;
try {
.
. // instantiate an ado connection and an recordset object
.
spConn->Provider = L"MSDataShape";
spConn->Open(szConnect, _bstr_t(), _bstr_t(), -1);spDataset->PutRefActiveConnection(spConn);
spDataset->PutCursorLocation(adUseClient);
spRS->Open(szShapeCmd, vtMissing, adOpenForwardOnly, adLockReadOnly, adCmdText);
spRS->PutRefActiveConnection(NULL);::VariantClear(pDataset);
V_VT(pDataset) = VT_DISPATCH;
V_DISPATCH(pDataset) = (IDispatch*)(spDataset.Detach());m_spObjectContext->SetComplete();
_hr = S_OK;
}
catch(const _com_error &ex) {
[...]
}
catch(...) {
[...]
}I've tried to debug my component and I found out that the call to CBizLayer::GetEvents() method completes without any error (i.e. with an HRESULT of S_OK), but in the client application, I still receive this error :wtf: :wtf:. Why? What could be the reason? I am totally confused! Please help! Gurmeet
BTW, can Google help me search my lost pajamas?
My Articles: HTML Reader C++ Class Library, Numeric Edit Control
-
Weapons of Mass DestructionTry this on Google search soon before someone asks Google to fix it. Open Google.com, type "weapons of mass destruction" (without quotes) and click I'm Feeling Lucky button instead of Google Search. Very Cool :laugh: Gurmeet
BTW, can Google help me search my lost pajamas?
My Articles: HTML Reader C++ Class Library, Numeric Edit Control
-
Fingerprint and Signature RecognitionI googled for "fingerprint SDK" (with quotes) and the first result was an SDK from IBM. Its overview says "The IBM Fingerprint SDK is independent of the actual sensor used." Can this SDK be used in my project? Even if it can be, I'm not able to find out any SDK download page. Any more info on it? Also check out the first few results, there are some more sensor-independent SDKs available ( http://www.bioenabletech.com/fingerprints_software_development_kit.htm [^]) but no options for download. Thanks Gurmeet
BTW, can Google help me search my lost pajamas?
My Articles: HTML Reader C++ Class Library, Numeric Edit Control
-
Fingerprint and Signature RecognitionThank you for instant reply. What about commercial apps? Gurmeet
BTW, can Google help me search my lost pajamas?
My Articles: HTML Reader C++ Class Library, Numeric Edit Control
-
Fingerprint and Signature RecognitionI need to develop a project that can benefit from these two technologies. But I never tried my hands on any biometric solution before. Can anyone of you please help? What I need to know is that a) is there any recognition SDK available or what? b) are there any free open source SDKs too? c) how easy is to integrate one into our own applications? Any help will be greatly appreciated. Thanks Gurmeet
BTW, can Google help me search my lost pajamas?
My Articles: HTML Reader C++ Class Library, Numeric Edit Control
-
Where is my prize?WTF is the use of this voting thing if you are never gonna get the prize this site promises? X| I am the prize winner for the month of March 2004, but i've never been contacted after that. This is what was written in the mail I received from Chris Maunder on May 04, 2004. ------------------------------------------- From : Chris Maunder <chris at codeproject dot com> Sent : Tuesday, May 04, 2004 5:23:54 AM To : <gomzygotit at hotmail dot com> Subject : Congratulations from CodeProject! Hi Gurmeet, Congratulations! You have won the CodeProject article competition for March. Category : MFC / C++ Article : HTML Reader C++ Class Library Location : http://www.codeproject.com/library/GomzyHTMLReader.asp Prizes : Dundas Grid 6.1 from Dundas Software. Value: $399 Visual Assist .NET from Whole Tomato. Value: $79 In total you have won $478 in prizes. Well done! The companies donating the prizes have been notified and will be in contact you soon. Again - thanks for your contribution to the CodeProject community. Chris Maunder www.codeproject.com ------------------------------------------- Can you please explain whatz goin on Chris. Gurmeet
BTW, can Google help me search my lost pajamas?
My Articles: HTML Reader C++ Class Library, Numeric Edit Control
-
Changing Size Font and Vertical Scroll BarBefore a call to the device context functions, you need to select the graphics object(s) you need to work with; in your case, a CFont object. Write the following statements before and after a call to the
DrawText(...)
function respectively: BeforeCFont *pOldFont = dc.SelectObject(&font);
Afterdc.SelectObject(pOldFont);
Gurmeet
BTW, can Google help me search my lost pajamas?
My Articles: HTML Reader C++ Class Library, Numeric Edit Control
-
Extracting files from resourceSo where exactly are you facing problem in this code? How are you going to know where the error occured as: - Your code never calls
GetLastError()
to find out if a call to WIN32 Resource API succeeded or not. -FindResource()
,LockResource()
andLoadResource()
returnsNULL
in case of an error, you are not even performing any checks for that condition too. - Are you sure the call toCreateFile()
is succeeding, try usingGetLastError()
to know why it failed. - You are not comparing the value of variableWritten
with the variableSize
to know exactly if a call toWriteFile()
succeeded or not. Points regarding your code: 1. Please moveUnlockResource()
out of the if block. 2. It is not necessary for Win32-based applications toFreeResource
. A resource is automatically freed when its module is unloaded. Gurmeet
BTW, can Google help me search my lost pajamas?
My Articles: HTML Reader C++ Class Library, Numeric Edit Control
-
Hey YaRoger Wright wrote: I hope you didn't open it... No I Didn't :) Gurmeet
BTW, can Google help me search my lost pajamas?
My Articles: HTML Reader C++ Class Library, Numeric Edit Control
-
Hey YaJust found a mail in my inbox from webmaster@codeproject.com with the subject "Hey Ya =))". The body contains:
I don't bite, weah!
password -- 80780
It also contains the attachment
Readme.zip
that contains a screensaver file. Gurmeet
BTW, can Google help me search my lost pajamas?
My Articles: HTML Reader C++ Class Library, Numeric Edit Control
-
VS.NET 2003 Internal Compiler errorsAnders Molin wrote: What about a rebuild, does that fix it? Got the same error a few days back but a rebuild fixed it. Gurmeet
BTW, can Google help me search my lost pajamas?
My Articles: HTML Reader C++ Class Library, Numeric Edit Control
-
String vs stringstring
is an alias forSystem.String
in the .NET Framework. Gurmeet
BTW, can Google help me search my lost pajamas?
My Articles: HTML Reader C++ Class Library, Numeric Edit Control
-
Text Readers, Streams, *ugh*What, according to you, can be done to make it more efficient? Gurmeet
BTW, can Google help me search my lost pajamas?
My Articles: HTML Reader C++ Class Library, Numeric Edit Control
-
Text Readers, Streams, *ugh*Your solution suggests using
BaseStream,
property ofStreamReader
class. But I don't only need to deal with files, I need to deal with strings also. TheStreamReader
class has aBaseStream
property but theStringReader
class does not. What do you suggest in this case? Moreover, I would like to ask you whether the "alternate way" that I've posted above is right according to you in this situation or not. Thanks, Gurmeet
BTW, can Google help me search my lost pajamas?
My Articles: HTML Reader C++ Class Library, Numeric Edit Control
-
Text Readers, Streams, *ugh*... but I'm not sure if its the right one. Now my class looks like this:
public class LiteHTMLReader
{
private System.IO.Stream oHtmlStream;public long Read(string htmlText)
{
using (this.oHtmlStream = new System.IO.MemoryStream(System.Text.Encoding.Unicode.GetBytes(htmlText)))
{
long lCharCount = this.parseHTMLDocument();
return (lCharCount);
}
}public long ReadFile(string pathToFile)
{
using (System.IO.StreamReader sr = new System.IO.StreamReader(pathToFile, true))
{
string strFileData = sr.ReadToEnd();
return (this.Read(strFileData));
}
}
}I dunno why but I dont think this is the actual way to do it. Can someone clear my doubts? Heath Stewart, Mike Dimmick, any other C# guru, where are you guyz? Please help. Thanks, Gurmeet
BTW, can Google help me search my lost pajamas?
My Articles: HTML Reader C++ Class Library, Numeric Edit Control
-
?? Protector ??Howcome Heath and Nick got the status of CodeProject Protector? What does it actually mean? Gurmeet
BTW, can Google help me search my lost pajamas?
My Articles: HTML Reader C++ Class Library, Numeric Edit Control
-
Text Readers, Streams, *ugh*Hi, while writing a .NET port of my HTML Reader Class Library[^] using C#, I'm kinda stucked with a stupid problem. You may be knowing that the library allows to read HTML text both from in-memory strings and disk files. At first I declared a private field of type
System.IO.TextReader
in myLiteHTMLReader
class (the main class of the library) and defined aRead
function with 1 overload. Some portion of the class looked like this:public class LiteHTMLReader
{
private System.IO.TextReader oHtmlReader = null;public long Read(string htmlText)
{
oHtmlReader = new StringReader(htmlText);
return (parseHTMLDocument()); // parseHTMLDocument is a private function
}public long Read(string pathToFile, System.Text.Encoding encoding)
{
oHtmlReader = new StreamReader(pathToFile, encoding, true);
return (parseHTMLDocument());
}
}But soon enough, I learned that readers (derived from
System.IO.TextReader
) are just forward-only. But sometimes while parsing an HTML document, I need to move back also. So, I rejected the idea of using readers. So obviously, my next option was using streams. Ok now we have aSystem.IO.FileStream
class to deal with files, but what about thestring
s. - How can I open a stream on a string? - Is there any class available in the framework? - Shall I go for my own implementation? - Any other better option availble for the above-defined scenario? Please suggest. Even if I use streams, there is one more thing I need to know.Stream
s deal with bytes only (GetBytes
).String
class uses Unicode by default. How to deal with this situation? Guys, I'm so sorry for asking soooooo much but you can obviosly guess that I'm a newbie in C#. And I'm getting mails daily from different people requesting me to release a .NET port of the library. Please help. Any suggestions are welcome. Regards, Gurmeet
BTW, can Google help me search my lost pajamas?
My Articles: HTML Reader C++ Class