|
Yes, if you give your program to a friend they must have the correct DLLs resident on their machine. This is generally not a problem but older machines may have a MFC42.dll that is out of date. ComCtl32.dll is another one to watch out for but machines with recent OSs and service packs should be fine.
Regarding BOOL and bool, BOOL is a type defined as an int in windef.h. bool (lower case) is a built-in variable type having a size of 1 byte and this is from the standard. It is best to leave BOOL as BOOL because they are different types as of MSVC v5.0.
|
|
|
|
|
Okay. Thanks.
First, I would really want to multi-thread using DLL (dynamically). I will post the errors as soon as I get access to the source at home.
One more question about MFC syntax. I learn from Deitel & Deitel to using "0" instead of "NULL." However, MFC uses "NULL" consistantly. Should I use "NULL" as Promise implements it?
Kuphryn
|
|
|
|
|
Okay. I tested two versions of multi-threaded DLL.
multi-threaded DLL (DEBUG): Here are the errors when I tried to compile.
----------
-----
Hello error LNK2001: unresolved external symbol ___argc
-----
Hello error LNK2001: unresolved external symbol ___argv
-----
Hello error LNK2001: unresolved external symbol __mbctype
-----
Hello error LNK2019: unresolved external symbol __mbctype referenced in function "public: void __thiscall CEditView::ReadFromArchive(class CArchive &,unsigned int)" (?ReadFromArchive@CEditView@@QAEXAAVCArchive@@I@Z)
-----
Hello error LNK2019: unresolved external symbol __mbctype referenced in function "void __stdcall AfxFormatStrings(class ATL::CStringT<char,class strtraitmfc<char,class="" atl::chtraitscrt<char=""> > > &,unsigned int,char const * const *,int)" (?AfxFormatStrings@@YGXAAV?$CStringT@DV?$StrTraitMFC@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@IPBQBDH@Z)
-----
Hello fatal error LNK1120: 3 unresolved externals
-----
----------
multi-threaded DLL: Here are the errors when I tried to compile.
----------
-----
Hello error LNK2001: unresolved external symbol ___argc
-----
Hello error LNK2001: unresolved external symbol ___argv
-----
Hello error LNK2001: unresolved external symbol __mbctype
-----
Hello error LNK2019: unresolved external symbol __mbctype referenced in function "public: void __thiscall CEditView::ReadFromArchive(class CArchive &,unsigned int)" (?ReadFromArchive@CEditView@@QAEXAAVCArchive@@I@Z)
-----
Hello error LNK2019: unresolved external symbol __mbctype referenced in function "void __stdcall AfxFormatStrings(class ATL::CStringT<char,class strtraitmfc<char,class="" atl::chtraitscrt<char=""> > > &,unsigned int,char const * const *,int)" (?AfxFormatStrings@@YGXAAV?$CStringT@DV?$StrTraitMFC@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@IPBQBDH@Z)
-----
Hello fatal error LNK1120: 3 unresolved externals
-----
Hello warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
-----
----------
I would like to compile MFC using multi-threaded DLL, thus making the program smaller.
Thanks,
Kuphryn
|
|
|
|
|
Okay. I figured out the problem. The problem was there were mismatch settings in the project. The probject was default to Applicantion(exe) and Standard Windows Libraries. I had to set the project to use "Shared MFC DLL" instead of Standard Windows Libraries.
The executed size shrinks from 1.5mb to 100k in debug mode.
Kuphryn
|
|
|
|
|
I've recently upgraded to VC7,When I wanted to add some activex to my project,I couldn't find Adoc and MSDataGrid,Does anybody know is there any new activex instead of them or what happend to them or any idea?
Mazy
Don't Marry a Person You Can Live With...
Marry Someone You Can Not Live Without
|
|
|
|
|
double& GetDouble(void* p)
{
double* pd = (double*)p;
}
modified 29-Aug-18 21:01pm.
|
|
|
|
|
return *pd;
I vote pro drink
|
|
|
|
|
Thank you. It has been a long day and I am not thinking right. This is an indicator that I have to go home and get some sleep.
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Another question guys. This time it should be REALLY simple but I'm too tired/lazy to look it up. Here goes:
I made a map editor that in the end scans the map you made and saves it in a two-dimentional array. Then it opens a file and writes the array to it.
The problem is that it's saved in one row and I'd like it to show as a matrix when you view the file.
So how do I instruct the FilePointer to drop a line?
By the way I used the WriteFile finction and all that API stuff, not MFC.
Isaac Sasson,
Small time programmer - complainer at large.
Sonork ID 100.13704
|
|
|
|
|
With a \r\n
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
ROFL
Now don't I feel stupid...
My brain is starting to degenerate, must be all those Neighbours episodes I've been watching
Isaac Sasson,
Small time programmer - complainer at large.
Sonork ID 100.13704
|
|
|
|
|
Isaac Sasson wrote:
Neighbours episodes I've been watching
What show is this...?
In Canada we get mostly American TV like most of the world and i'e never heard of this...?
Sounds like a knock off of friends...
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
It's an Aussie drama, though christian claims it to be a soap oepra. I think it's not because the issues that are quite normal and not "my evil twin stole my mutant baby" and stuff like that.
It's about the lives of the people in the same street.
Isaac Sasson,
Small time programmer - complainer at large.
Sonork ID 100.13704
|
|
|
|
|
Of course it's a soap opera. And surely they've run the "my evil twin stole my mutant baby" plot by now? They've done everything else already.
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
OHHHH! Neighbours...yes I know what show your talking about now...We do get it...
I've never really watched it though...Soap...no way...you don't know Soap's until you've seen some sh*t day time television. Hollywood style...horrible...people fly and have sex with each other's other! and oh my god...all the people are beautiful...enough to make ya sick...Neighbours though...naw! it's more like Britain's Are you being served.
Later!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Hey Guys i have a DLL that integrates with explorer and when i add my own functions that i export it causes the DLL to crash and therfore explorer any ideas.
Peter
|
|
|
|
|
A possible reason could be the export order of your functions. Explorer may import an extension DLL using ordinal numbers for the functions that it imports. By exporting a function of your own, you may have inadvertantly changed the ordinal numbers of the functions you are exporting.
Try right-clicking your DLL and using QuickView to see the order they have been exported in. If they are incorrect for explorer (assuming it uses this method), you will need to reorder yout export list.
Roger Allen
Sonork 100.10016
If I'm not breathing, I'm either dead or holding my breath.
A fool jabbers, while a wise man listens. But is he so wise to listen to the fool?
Please step to the rear of the car and make room for more victims. - John Simmons the Outlaw programmer, 1st Feb 2002, in the lounge
|
|
|
|
|
Hey guys
I have a DLL that integrates with explorer which has MFC support. Anyway the program works fine normally but occasionally when one of my dialogs is displayed it comes up either as a the menu bar and then i have to drag it out to see the window or it comes up very small. has anyone got any ideas why this happens. It usually happens on the 2nd time i use the dll or later never on teh first.
This gives me the idea that memory isn't being propally deallocated.
Cheers
Peter
|
|
|
|
|
Hey Guys
When you have a pointer and want to get it to point to an array is it better to:-
pointer = new BYTE[ArraySize]
or
pointer = (BYTE*)malloc(ArraySize);
Peter
|
|
|
|
|
new, every time. Because you need to remember to delete new and to free malloc, it's better just to always use new. It uses malloc internally anyhow, but you should prefer new because it calls constructors and destructors on delete.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
And you don't have all those unsafe casting issues with new.
Tim Smith
Descartes Systems Sciences, Inc.
|
|
|
|
|
Only use malloc when coding in vanilla C.
/moliate
|
|
|
|
|
Do they do a strawberry C as well? I'm not so keen on vanilla!
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
|
I am looking for a function where I can pass a bianary string to a function that will return that value in Hexidecimal notation. The incoming string could vary in length. The output string will always be double what the input string will be. Here is an example of what I would like:
Input: C++
Output: 43 2B 2B
If possible I would like to eventually convert this to a compiled .dll in C++ that I can access within VB. The usage of this in VB is stricly due to a company restriction. I feel this proccess would be much more efficient in C++.
Thanks again ahead of time.
Nick Parker
|
|
|
|