|
Hello Friend,
In our case we have several static libs which are dependent on .exe. while running the .exe we want all the class static variables in the static libraries initialized before control reaches main. In Linux C++ compiler it is properly happening? How to make it happen in windows2000.
Any reply would be grateful.
Thanks,
-Sarma
|
|
|
|
|
Well, I'm afraid little more can be said with that information alone. As I said before, first you'd have to determine the cause of the problem (lib stripped out, interdependcy among static data initialization across several .cpp s, other.) If you could tell us something about the structure of your project or post some of the code of the offending library, that'd help a lot.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Link your program with a map file option. Then search to see if the .CPP file that contains the initialial values is included in the image.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
Hey, that's a powerful tool! Didn't know about it. How does one examine the image after building with this option?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Just look for a .MAP file in your build directory.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
How would I prevent my MFC app from trying to open a URL as a local document. I parse out the command line parameters, and it comes up with the url, but then the program throws an error about its attempt to try to open it as a document. I have tried Aborting Serialization, I have also tried changing the parameter to do FileNothing.
-Steven
|
|
|
|
|
Can't you override the code in the CDocument::OnNewDocument or which ever function is being called for the open document (its late and I can't remember the name - something like OnOpenDocument)
Michael
|
|
|
|
|
Does anyone know what the system stress test tool is called in Visual Studio 6. Used it a while ago, and can't remember what it was called or where to find it?
Thanks,
Giles
|
|
|
|
|
You can use my product MemWatcher to simulate low memory conditions during stress testing. It works on Win9x/ME/NT/2K/XP.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Thanks Ravi, will take a look.
Giles
|
|
|
|
|
Maybe you are remembering the Win16 "Stress" tool? For Win32 there simply is no such thing, you'd have to use all available virtual memory (or exhibit some NT kernel "bugs"/limits :->) to get what you want.
For GDI I recommend you create a "bunch" of small bitmaps (large bitmaps are put in another kind of memory) to watch even "system" menus go "System (Bold)" on you.
I think you can screw up the whole user(32) subsystem by messing around with window messages, but then your whole workstation would grind to a halt (been there, done that, MS refuses to acknowledge problems). You could however easily overflow both GDI and USER in Win9x by just creating ~32K objects.
For memory constrained uses, you could actually just SetProcessWorkingSetSize in your app to a reasonabley small value to see how your app crashes when it's out of memory.
Hope this helps. :->
|
|
|
|
|
I'm sure there was a tool, to perform different background taks such as heavy disk IO, or processor usage, on which you could turn up the notch.
Ah well.
Giles
|
|
|
|
|
I have made an MFC Application that works against a SQL Server using ODBC with the CRecorset classes. But when I hav made a workable setup program and runs this on another computer(that does not have visual studio) the installation works fine but when i try to run the exe file i get a VC++ Runtime library Error! Abnormal program termination. What have I've done wrong ..please Help..
Best regards
Henrik
|
|
|
|
|
use the 'depends' tool to see what dll's ur app requires and make sure they are in the package u dist
situations to avoid #37: "good morning ... how many sugars do you take in your coffee ... and what was your name again?"
coming soon: situations to avoid #38: "...and the dog was there too?"
|
|
|
|
|
I would but I'm running VS . net and the dependencies shows up on a prpertysheet.. it only says that it depends on 2 dll's mfc70*..... Are there any other way?
If not...
Thank you for your reply anyway
|
|
|
|
|
HenrikO wrote:
I have made an MFC Application that works against a SQL Server using ODBC with the CRecorset classes. But when I hav made a workable setup program and runs this on another computer(that does not have visual studio) the installation works fine but when i try to run the exe file i get a VC++ Runtime library Error! Abnormal program termination. What have I've done wrong ..please Help..
What type of error are you receiving when you try to run your app? Does the PC you are trying to set up your app on have all the MFC runtime libraries installed? You should read through this part of the C++ FAQ. It deals with a problem that sounds similar (if not exactly the same) to yours. Hope this helps.
-Mike Zinni
Software Engineer
email: mzinni@rimail.com
AIM: zin9999
|
|
|
|
|
Try using Installshield . it actually does the job of searching for dll's and required ocx's required .
or
While building the code , check the project settings. Try including all the dll's during compilation.
or
if u know the dlls required , copy them in the new pc and register theses Dll's using regsvr32.exe
|
|
|
|
|
Do you have the same version of MDAC installed on both machines?
Also does the release version work on your development machine?
Michael
|
|
|
|
|
Hi,
I´m making a thing that seems to work ok, but I´m not quite sure if it´s right done or not ( my ANSI C experience tell me... NAAAAA ! MALLOC MAAAN AND COPY THE BUFFER.... ), it´s quite basic asigning to a text node an (char *).
char buf[255];
MSXML2::IXMLDOMNodePtr pCostSelNode = _pXMLClonedDoc->selectSingleNode((BSTR) strCostSelNode);
if(pCostSelNode != NULL) {
itoa(iIndex, buf, 10);
pCostSelNode->text = buf;
}
Is correct to assing to the bstr that buffer in that way ( I suposse if it´s _bstr_t friendly it should but... ).
Thanks in advance, greetings
Braulio
|
|
|
|
|
What is the type of strCostSelNode ?? If it is not BSTR, you must convert it. Typecasting is not enough, in the case of a BSTR. Ex:
<br />
USES_CONVERSION;<br />
wchar_t *strCostSelNodeW;<br />
char *strCostSelNodeA;<br />
_TCHAR *strCostSelNodeT;<br />
<br />
BSTR bsCostSelNode1 = W2BSTR(strCostSelNodeW);<br />
BSTR bsCostSelNode2 = A2BSTR(strCostSelNodeA);<br />
BSTR bsCostSelNode3 = T2BSTR(strCostSelNodeT);<br />
<br />
MSXML2::IXMLDOMNodePtr pCostSelNode = _pXMLClonedDoc->selectSingleNode(bsCostSelNode1);
<br />
::SysFreeString(bsCostSelNode1);<br />
::SysFreeString(bsCostSelNode2);<br />
::SysFreeString(bsCostSelNode3);<br />
Tell me if you need more info.
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
Thanks for the tip,
Sorry, I forgot to write there the type of strCostSelNode, and it was "CComBSTR".
Anyway is a perfect example for me, if I have to convert from all that types to BSTr, thanks a lot.
Braulio
PS.: If I declare a variable in MFC using _bstr_t, do I need to free it, before it goes out of scope ?, b.g.:
void MyMethod()
{
_bstr_t MyVar = "MyText";
(...)
}
|
|
|
|
|
I want to display the CFontDialog dialog with the DoModal() method, but the font and it's properties (size, style, colour) already selected.
For example when the dialog is displayed, the Arial 12 italic RED is selected.
How do I do that ?
|
|
|
|
|
After you've created you dialog, but before DoModal(), modify the m_cf member of your dialog. Set m_cf.Flags to CF_INITTOLOGFONTSTRUCT and m_cf.lpLogFont to point to a LOGFONT object of your choice.
You can use CFont::CreateFont() to initialize a font, and then use CFont::GetLogFont() to get the underlying LOGFONT.
|
|
|
|
|
I have tried like you told me:
CFontDialog dlg;
LOGFONT* logf;
logf=new LOGFONT;
font1.GetLogFont(logf); //font1 is a valid font created before (Arial 12)
dlg.m_cf.Flags=CF_INITTOLOGFONTSTRUCT;
dlg.m_cf.lpLogFont=logf;
dlg.DoModal();
It doesn't work. I get an assertion failure at the DoModal method. If I debug it, the error is at the line:
ASSERT(m_cf.Flags & CF_ENABLEHOOK); in the CFontDialog::DoModal method, defined in dlgfnt.cpp.
If I don't debug it and I choose Ignore, It says: "There are no fonts installed. Go to the Control Panel.......".
What is the problem ?
|
|
|
|
|
it's ok. I resolved that. I had to set also the flags CF_ENABLEHOOK | CF_BOTH | CF_EFFECTS.
Thanks.
|
|
|
|