> The function you list isn't NS_InitXPCOM2, it's probably further down.
I rechecked the dump, but this is the only exported entry that I found > > 1619 652 0000481F >?NS_InitXPCOM2@@YAIPAPAVnsIServiceManager@@PAVnsIFile@@PAVnsIDirectoryServiceProvider@@@Z > In any case if you did LoadLibrary and then GetProcAddress and that > worked, then it's probably there. Yes, its there. > You say you are using the XPCOM.DLL from Netscape 6.2. Where are you > getting the .lib to link against, and the header files? These need to be > in sync. After posting my previous message I gave a thought to this point, you are right I was linking to the Mozilla build XPCOM.LIB, hence it was working for the XPCOM.DLL that exist in the Mozilla build and I was through. But was failing for the Netscape. >If you really need to use the 6.2 one, then you'll need to get >or build the corresponding .lib and headers. How and where do I get these Netscape files? > Here's where you're going to run into problems. Currently the only real > way to invoke a method is from C++. What you would need to do is provide > a C wrapper around the XPTC_InvokeByIndex function and nsXPTCVariant. > Once this is done, you can then manually invoke AddRef and Release > methods, to effect what nsCOMPtr is doing. Do you mean I can avoid the nsCOMPtr? I have found that there exist a entry point for "XPTC_InvokeByIndex" function, but I am unable to use this, can you please give me a sample for this, I possible as I am really new for COM. Thanx, Nitin David Bradley <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > Nitin wrote: > > After taking a Dump using dumpbin /export I can view that the => > > NS_InitXPCOM2 is exported as follows : > > ================= > > O/P of => Dumpbin /exports > > > > 1619 652 0000481F >?NS_InitXPCOM2@@YAIPAPAVnsIServiceManager@@PAVnsIFile@@PAVnsIDirectoryServiceProvider@@@Z > > ================= > > As well as I tried using LoadLibrary for XPCOM.DLL and queried for > > NS_InitXPCOM2 this was also successful. > > The function you list isn't NS_InitXPCOM2, it's probably further down. > In any case if you did LoadLibrary and then GetProcAddress and that > worked, then it's probably there. > > > Can you please shed some more Light on the failure of NS_InitXPCOM2, > > for Netscape's XPCOM DLL. > > You say you are using the XPCOM.DLL from Netscape 6.2. Where are you > getting the .lib to link against, and the header files? These need to be > in sync. If you really need to use the 6.2 one, then you'll need to get > or build the corresponding .lib and headers. > > > One more question I face is that can we avoid using the SmartPointer > > (nsCOMPtr)? If yes, please let me know how? with a sample if possible. > > Here's where you're going to run into problems. Currently the only real > way to invoke a method is from C++. What you would need to do is provide > a C wrapper around the XPTC_InvokeByIndex function and nsXPTCVariant. > Once this is done, you can then manually invoke AddRef and Release > methods, to effect what nsCOMPtr is doing. > > David B.
