|
All of our source is currently written in Borland C which allows the use of #pragma startup 'function_name' which ensures that a function is run when a program is started. Is there an equivilent method in Visual C++?
|
|
|
|
|
Hmmmm.... no - I don't think there is. You can alter the apps entry point, but if I read you correctly I think what you want is a function that gets called before main/WinMain or whatever during runtime init. Best substitute I could think of would be a global static class that performs 'function_name' code in its ctor.
|
|
|
|
|
Create some dummy class with startup code in constructor. Make a global variable of the class - the constructor will be called before main or WinMain.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Thanks for your suggestions. A class that handles the startup/exit code in the constructor/destructor will do nicely.
|
|
|
|
|
i received this linking error:
LINK : warning LNK4098: defaultlib "LIBCD" conflicts with use of other libs; use /NODEFAULTLIB:library
does anyone knwo hwo to resolve this?
thanks in advance
|
|
|
|
|
I find that one thing that can cause this message is the following
(Im using VC++ 5.0):
When you create you Win32 Appwizard application, you are asked whether you you wish to use MFC as a shared DLL or as a static library.
When you create a ".lib" type project you have 3 options...
Using MFC in a static library
Using MFC in a shared DLL
Not using MFC
The ".lib" projects which your Win32 application links in should (in normal situations) be using MFC in the same way as your Win32 app.
For example, I built a ".lib" which used some MFC calls, and I mistakenly selected "Not using MFC" when I created the project, and
it generated exactly the same message as you quote above.
Dave Carkeet,
Santiago, Chile
|
|
|
|
|
Hi all.
If anyone have source code about using MsComm control in program, please send to : hadi_rezaie@hotmail.com
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
When I tried to link MFC libraries statically, I got:
nafxcwd.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) already defined in LIBCMTD.lib(new.obj)
nafxcwd.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) already defined in LIBCMTD.lib(dbgdel.obj)
Any suggestions????
|
|
|
|
|
Yep - "PRB: LNK2005 Errors When Link C Run-Time Libs Before MFC Libs"
MSKB article ID: Q148652
|
|
|
|
|
hi can somebody tell me how can i put Item checked in a Clistrl into a table
using CStringArray i think.
thanks for your reply.
Somoene who really needs help.
|
|
|
|
|
Please write, what is You goal.
I don't quite understand, why are You trying to use CStringArray with CListCtrl to achieve checkboxes???
Try to look at CCheckBoxList - if You want to have check list box.
For check list control, You have to write Your own or search on the web (there is one in Stingray package). AFAIK there is no such control in MFC.
|
|
|
|
|
I'm sorry if i wasn't clear!!
I had just ask that when i click in a checkbox inside a list control how can i retrieve the item text checked in a table.
I ve heard that u must use CStringArray!!!!!
I hope that i ve exposed my goal clrealy, but I m not sure.
Reply me if u still not understand
bye
|
|
|
|
|
hi can somebody tell me how can i put Item checked in a Clistrl into a table
using CStringArray i think.
thanks for your reply.
Somoene who really needs help.
|
|
|
|
|
HI,
I have a file pointer, How to get file name?
Actually in costructor i am giving file name, and opening a file there. i am storing file pointer as amember variable, I am not interested storing file name as member variable. I am doing all file operations. but in some other fucntion i need file name, here i have only file pointer. How will i get file name from file pointer? Is there any fcuntion?
Thanks in advance,
- Koteswara
theearth1947@yahoo.com
Perumalla Koteswara Rao,
Hyderabad, India
Thanks in advance,
Koteswara Rao, Perumalla
theearth1947@yahoo.com
|
|
|
|
|
Please clarify - that is the "file pointer" ? CFile* pFile ? ifstream * pfstream ? handle of file ... or what ?
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru
|
|
|
|
|
It's FILE* pointer.
Thanks in advance,
Koteswara Rao, Perumalla
theearth1947@yahoo.com
|
|
|
|
|
Please clarify - that the "file pointer" is ? CFile* pFile ? ifstream * pfstream ? handle of file ... or what ?
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru
|
|
|
|
|
How?can anybody help mi?
LIFE MUST GO ON
|
|
|
|
|
look at: http://www.libtiff.org/
|
|
|
|
|
Check this out.
http://www.paintlib.de/paintlib/
|
|
|
|
|
When i use class wizard to create a class delivered from CCmdTarget and support automation, the wizard defines constructor/destructor as protected.
(I think this has something to do with dynamic construction or something)
This doesn't allow me to create any instance of that class.
So, i just makes the constructor/destructor public and everything
works allright!
Is this a known bug of the wizard,
or i must create those classes in a special way?
What kind of problems can my aproach cause, if any?
- - - - - - - - - - - - - - - - - -
Memory leaks is the price we pay \0
01234567890123456789012345678901234
|
|
|
|
|
The guys at Redmond just assumed you'd only want to create a class their way I guess. I use (non-automation) CCmdTarget classes all the time and make exactly the same modification you have done.
Andy Metcalfe - Sonardyne International Ltd (andy.metcalfe@lineone.net) http://www.resorg.co.uk
"I used to be a medieval re-enactor, but I'm (nearly) alright now..."
|
|
|
|
|
I made a tempalte class,like
template <class t="">
class A
{
A();
~A();
}
template<class t=""> A<t>:: A(){};
tempalte<class t=""> ~A<>:: ~A(){};
double click on the function in ClassView Window,I can not goto the definition of the function,
Why?
|
|
|
|
|
does anyone know how to store hexadecimal numbers? cwhich data types can store hex numbers in the form 0xffff1234 and let the compiler readily read it as a hex number and not as a string. is dword such a data type?
|
|
|
|
|
There's no difference between hexadecimal and decimal numbers at all (for a compiler). Store it as a DWORD or a unsigned int and uses formatting functions or streams with hex manipulator when you need a textual representations of the number.
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru
|
|
|
|