|
To my knowledge none of the Borland C++ programs understand visual studio projected/solution files. However, Visual Studio 6.0 has the option to create a make file, which you could modify to work with the Borland compiler.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
do u know how to get character matrix in win and dos?
e.g:
1 character matrix is similar to that:
0000x0000
0000x0000
0000x0000
0000x0000
0000x0000
Thank you!
Hello World!
|
|
|
|
|
char buffer[20];
int iYourNumber = 0;
sprintf( buffer, "%x", s );
Convert it to HEX?
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
In VC6.0,how to change a project from Release to Debug for debuging it?
Thank you very much first!
Rap off for you,for me,for our human.
|
|
|
|
|
Look on the Build toolbar, there's a combo box that says "Win32 Release". Change that to "Win32 Debug"
--Mike--
Ericahist | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber
There is a saying in statistics that a million monkeys pounding on typewriters would eventually create a work of Shakespeare. Thanks to the Internet, we now know that this is not true.
|
|
|
|
|
Right click on the top and make sure that you select:"Build" and then change it in the combo box
|
|
|
|
|
Or if you want to debug in release mode, in your linker option.
Project Setting - Link - check the Generate Debug Info
and
Add #define _DEBUG into your source code.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
I'm trying to use DllMain() to take care of some library/thread initialization and cleanup stuff, but no matter what I try I cannot get DllMain invoked for any of the four events for which it is supposed to be getting invoked! (I.e., process attach, thread attach, thread detach, process detach.)
I found the following sentence in the MSDN description of DllMain():
"DllMain is a placeholder for the library-defined function name. You must specify the actual name you use when you build your DLL. For more information, see the documentation included with your development tools."
Is there some Dev Studio project setting I should be making to identify the name of my library entry point function?
Another tidbit of information: I'm using simple load-time linking for my DLL. The MSDN DllMain description makes reference to LoadLibrary and FreeLibrary (functions you use for run-time dynamic linking). I sould be interested in hearing confirmation that DllMain IS compatible with simple load-time dynamic linking.
Thanks much,
Matt
|
|
|
|
|
Matthew,
further to your (previous) question:
DllMain of your *.dll library gets called on
1.program startup, if your user staticly linked to the *.lib library of your *.dll project when compiling his app. (also called load time or explicit linking)
2.your user calling LoadLibrary, FreeLibrary from his code (also called runtime or implicit linking)
In case 1./ the user of your library has to get from you a *.lib and a *.h file of your library in order to compile his project, and of course your *.dll to run with your *.dll attached.
In case 2./ the user of your library has to get from you an *.h file of your library (i.e. function prototypes) to compile his code (by calling LoadLibrary, GetProcAddress and FreeLibrary) and your *.dll to run the library functions.
Peter Molnar
|
|
|
|
|
Peter,
Thanks for your confirmation that this at least should work. So why then is my DllMain not getting invoked. Here's my current inplementation:
#include "MyHeader.h"
#include "windows.h"
BOOL DllMain(HINSTANCE , DWORD pReason, LPVOID ) {
try {
printf("I'M HERE!\n");
int *x = NULL;
*x = 20;
switch (pReason) {
case DLL_PROCESS_ATTACH:
MyProcessAttach();
MyThreadAttach();
break;
case DLL_THREAD_ATTACH:
MyThreadAttach();
break;
case DLL_THREAD_DETACH:
MyThreadDetach();
break;
case DLL_PROCESS_DETACH:
MyThreadDetach();
MyProcessDetach();
break;
default:
break;
}
}
catch(std::exception& x) {
std::cerr << x.what() << std::endl;
return FALSE;
}
return FALSE;
}
where all the stuff in bold is just some garbage I've added trying to get it to print something, or crash or generate some failed load situation to show me that the function is getting called. It would certainly seem this function is never getting invoked. What the heck is going on?
Again, do I need some project setting to identify this as an entry point function for the library?
Matt
|
|
|
|
|
I have created a small project which contains 4 lines of code:
#include <windows.h>
BOOL DllMain(HINSTANCE , DWORD , LPVOID )
{
::MessageBox(NULL,"test","Caption",MB_OK);
return TRUE;
}
and call it
HINSTANCE hInstance = LoadLibrary("pathto.dll");
works just fine.
Try the same. What is hInstance when you debug?
Peter Molnar
|
|
|
|
|
Much thanks to Peter Molnar for mailing me a completely trivial DevStudio project containing a DllMain() that got properly invoked. What I was missing (and what I had never seen documented) was the APIENTRY declaration for the DLL entry point function. The DllMain must be declared like this:
BOOL APIENTRY DllMain(HINSTANCE , DWORD , LPVOID )
Once those 8 pesky characters were added, it worked great.
Also, for those who care, this works independently of the application type (i.e., works for both console apps and windows apps) and (as Peter said in an earlier message on this thread) works independently of how the library is loaded. (I.e., you can use either load-time dynamic linking or run-time dynamic linking.)
Matt
|
|
|
|
|
If this is VC6: in the Link tab, select the Output category, and ensure that Entry Point Symbol is either blank or set to _DllMainCRTStartup. You should also check that the /NOENTRY switch is not specified.
Both of you: be careful with your dependencies. The only routines you can guarantee will be initialised before your entry point is called are those implemented by KERNEL32.DLL . You should also be able to call C library functions if you're linking with the C run-time.
|
|
|
|
|
I have a floating CDialogBar whose caption I can't seem to change with SetWindowText. Does anyone know how to change the caption text?
Thx,
|
|
|
|
|
|
I am having a difficult time with the following project:
http://www.cse.psu.edu/~cg103/NewHW/proj3.pdf
http://www.cse.psu.edu/~cg103/NewHW/alice.txt
Can anyone toss me a hint (pseudocode would be great!).
|
|
|
|
|
Anonymous wrote:
I am having a difficult time with the following project:
Are you having a difficult time, or have you not started and are running out of time?
The encyption algorithm has been given to you:
"For a given message, we substitute each lowercase character to the other character
whose ASCII code is less than 6."
This tells you that you can ignore any characters that aren't lower case letters (ie you only need to encrypt chars whose ascii values are between 97 and 122, inclusive)
So, a high-level step-by-step process list could be:
1) Get next character
2) Is it a lower case letter?
No: Store it as is
Yes: subtract 6 and then store it
3) Is it the last character?
No: GOTO #1
Yes: EXIT
In pseudocode:
OPEN input file
LOOP
GET character from file
IF character is lower case letter
subtract 6 from it
STORE character
IF end of file
EXIT LOOP
END LOOP
CLOSE input file
OPEN output file
LOOP
GET encypted character
WRITE encrypted character
IF end of encypted characters
EXIT LOOP
END LOOP
CLOSE output file
|
|
|
|
|
I am creating a dll (non-MFC). I am getting linker errors from the .exe that is trying to link with it.
The linker is complaining about the static class variables, unresolved external symbol. How am I to "decorate" them? I've tried using __declspec(dllexport) but haven't had much luck.
Thanks
|
|
|
|
|
Well, I finally got it figured out, in case anybody is curious.
The compiler directive should be dllexport when compiling the dll, and dllimport when compiling the exe.
#ifdef _DLL_
#define DLL_GLOBAL __declspec(dllexport)
#else
#define DLL_GLOBAL __declspec(dllimport)
#endif
|
|
|
|
|
if i calloc() a buffer and write data into it and then later copy other data into it that is shorter than the original data (and zero terminated) will the entire original buffer be freed properly when i call free() on it?
"there is no spoon" biz stuff about me
|
|
|
|
|
|
|
That is my understanding. It is also my understanding that night will be followed by day in the coming hours. I could be mistaken about one or the other or both, but I'm fairly certain about both.
Matt
|
|
|
|
|
Edit: I'm not using MFC BTW
I made a blank DLL project, copied my resources over to the DLL compiled, everything is fine...
I then loaded my resource DLL inside my app...it's load fine...but nothing is showing...obviously my resources need special attention when stored in a DLL...
What steps do I have to take to make sure my Dialogs, Menus, etc...load...and are shown...?
Thanks
The word of the day is legs, let's go back to my house and spread the word
|
|
|
|
|