|
-
Oct 8th, 2006, 05:07 AM
#1
Thread Starter
Fanatic Member
compiling dll problem
hi, im trying to compile a simple dll but it gives me error.. i trying to create dll so that it can be referenced by vb6
--------------------Configuration: mCodes - Win32 Debug--------------------
Compiling...
StdAfx.cpp
Compiling...
mCodes.cpp
C:\Program Files\Microsoft Visual Studio\MyProjects\mCodes\mCodes.cpp(332) : error C2440: '=' : cannot convert from 'char *' to 'unsigned char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
C:\Program Files\Microsoft Visual Studio\MyProjects\mCodes\mCodes.cpp(334) : error C2664: 'strlen' : cannot convert parameter 1 from 'unsigned char *' to 'const char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Error executing cl.exe.
mCodes.dll - 2 error(s), 0 warning(s)
-
Oct 8th, 2006, 06:33 AM
#2
Re: compiling dll problem
You're trying to convert a pointer to unsigned char to a pointer to plain char. That doesn't work. Your code is faulty.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Oct 8th, 2006, 07:38 AM
#3
Re: compiling dll problem
fred = (unsigned char*)mychar;
something like that cast might help.
I don't live here any more.
-
Oct 8th, 2006, 07:44 AM
#4
Re: compiling dll problem
Bad idea. Never cast unless you know for certain that it's justified. Careless casting away of conversion errors is an extremely bad habit to get into.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Oct 8th, 2006, 08:05 AM
#5
Re: compiling dll problem
Fair point, I suggest it only in the absence of any code example that we can make a more informed suggestion upon.
I don't live here any more.
-
Oct 8th, 2006, 08:35 AM
#6
Thread Starter
Fanatic Member
Re: compiling dll problem
@CornedBee
could you help me in compiling?
br
-
Oct 8th, 2006, 08:42 AM
#7
Re: compiling dll problem
Help you in compiling?
How about you post the code that makes problems. As you can see from our discussion, our clairvoyance is not quite in tune.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|