• Advertisement
Sign in to follow this  

[.net] C# using DLL Network Library Problems.

This topic is 3934 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello. I am currently trying to code a server in C# using a .dll network library that was written and compiled in PureBasic. The DLL fails stating that it "Could not initialize COM!". Even trying to CoInitialize(null) myself by making calls to OLE32.dll it seems to fail. I was curious why this data library seems to work fine in other languages such as VB.net 2005, but not in Visual C# 2005? After doing an evaluation of the dll I find that it calls- function CoCreateInstance(const clsid: TCLSID; unkOuter: IUnknown; dwClsContext: Longint; const iid: TIID; var pv): HResult; stdcall; external 'ole32.dll' name 'CoCreateInstance' index 24; function CoInitializeEx(pvReserved: Pointer; coInit: Longint): HResult; stdcall; external 'ole32.dll' name 'CoInitializeEx' index 59; procedure CoUninitialize; stdcall; external 'ole32.dll' name 'CoUninitialize' index 98; The CoInitialize function seems to be what is failing. The only attributes I am passing to the library are my GUID, A value for DirectPlay's TCP/IP service, as well as a 32bit integer flag value. I seem to be able to call some other functions from this library without any issue. It just seems that it will not init this com object. Help please?

Share this post


Link to post
Share on other sites
Advertisement
This sounds like a .NET question, not a networking question. I'm pretty sure the problems you're having have nothing really to do with networking, and everything to do with the COM environment inside the .NET development you're using.

Btw: what version of MSVC# are you using? 2003? 2005? Orcas? Pro or Express? Can you post some of the code that is actually failing? How do you reference the COM assembly?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement