Link to home
Start Free TrialLog in
Avatar of XK8ER
XK8ERFlag for United States of America

asked on

c++ register newly created dll

hello there,
I followed this guide to create a DLL file from scratch and it was compiled successfully
http://msdn.microsoft.com/en-US/library/ms235638(v=vs.80).aspx

when I try to register the dll file with regsrv32 file.dll

I get this
was loaded but the entry-point dllregisterserver was not found

how can I make the dll file able to register?
Avatar of jkr
jkr
Flag of Germany image

There is absolutly no need to register a regular DLL such as yours. That has only to be done with COM DLLs, since these need to add information to the registry via a certain entry point (http://msdn.microsoft.com/en-us/library/windows/desktop/ms682162%28v=vs.85%29.aspx - "DllRegisterServer entry point"), see http://support.microsoft.com/kb/249873 ("How to use the Regsvr32 tool and troubleshoot Regsvr32 error messages")

BTW, the article you linked to is for .NET DLLs and does not really apply to native DLLs. For the unmanaged version of that walkthrough, see http://msdn.microsoft.com/en-us/library/ms235636%28VS.80%29.aspx ("Walkthrough: Creating and Using a Dynamic Link Library ")
Avatar of XK8ER

ASKER

okay, basically i'm trying to create a c++ dll file that can be registered with Regsvr32 successfully and also that I can import into vb.net and use.. is this possible?
It's just not necessary to register it ;o)
Avatar of XK8ER

ASKER

>>Creating and Using a Managed Assembly
okay but I like this one better


>>Creating and Using a Dynamic Link Library
cus this one I cant import into vb.net project

so which one do you recommend?
Avatar of XK8ER

ASKER

please try to help me here.. do I have to create a uuid in order to work??
You can use native (unmanaged) DLLs in a .NET project easily without registering them - the name is Platform Invoke (P/Invoke), see http://www.codeproject.com/Articles/4965/Using-Platform-Invoke ("Using Platform Invoke"), which comes with plenty of examples.

Sorry for being a bit brief erlier, but I had to leave...
Avatar of XK8ER

ASKER

You mean COM Interop? Yes, that's another way to do that, but IMO overkill if you only want to call plain functions from managed code, but you are the one to choose the poison ;o)
Avatar of XK8ER

ASKER

"""COM Interop""" beautiful..

.that's exactly what I am looking for.. going the easy way hum.. I like to learn every single method..so that I can later say if its simple.. if I am 7ft tall and i'm jumping a 5ft fence, I could say its very easy but if you are 4ft tall and you're trying to jump the same fence it will not be so easy for you.. therefore sometimes "easy" or "overkill" has different meanings to different people..
Erm, that's not the easy way at all, it would require your DLL to host a fully fledged COM object, and the ramifications are huge - what is it that you need the DLL to do?
Avatar of XK8ER

ASKER

I totally understand JKR, that's exactly the reason why I'm here..
I know for sure that there has to be a sample project somewhere that uses this COM Interop and its C++ and is able to be registered using regsvr32.. and that can be imported into vb.net..

I've done similar things like the "managed walk through" that one can be imported into vb.net but that's MSIL and I need it to be native code..
Avatar of XK8ER

ASKER

you say that its not needed to register dll but for example lets say that I am using the mathFuntions in the dll like (Add, Subtract,Multiply) etc..

I have compiled the dll from (Walkthrough: Creating and Using a Managed Assembly)

I make a new project in vb.net and start using those math function with (Platform Invoke) how can this dll know if the exe file that I have its 64bit or 32bit or what?
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial