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

Started by
0 comments, last by hplus0603 16 years, 9 months ago
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?
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?
enum Bool { True, False, FileNotFound };

This topic is closed to new replies.

Advertisement