Avatar of XK8ER
XK8ER
Flag 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?
C++Programming

Avatar of undefined
Last Comment
jkr

8/22/2022 - Mon
jkr

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 ")
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?
jkr

It's just not necessary to register it ;o)
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
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?
XK8ER

ASKER
please try to help me here.. do I have to create a uuid in order to work??
jkr

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...
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
XK8ER

ASKER
jkr

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)
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..
Your help has saved me hundreds of hours of internet surfing.
fblack61
jkr

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?
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..
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?
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
ASKER CERTIFIED SOLUTION
jkr

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question