|
I need to ask a question that's been bothering me for some time now. I created an SDI application from the Visual C++ wizard. Everything was fine then. When I added a function (that someone else) created in old C, all of a sudden the menu and status bar dissapeared and I haven't seen them since then. I get no errors after building the project but I can't make the bars appear, neither through menu->view nor with right clicking. Could it be that some old function (like atoi) has a side-effect on the program? All functions in the old C file are global to the project.
|
|
|
|
|
Sounds strange. 'Old functions like atoi' shouldn't have any side-effects. What is the purpose of function you've added?
Tomasz Sowinski -- http://www.shooltz.com
To some its a six-pack, to me it's a support group
|
|
|
|
|
It reads two files containing neurules definitions and variable definitions, asks the user to insert values to variables and then uses the neurules to make an inference. It also evaluates the rules if needed. My part was to convert all the 'printf' calls to something visual.
|
|
|
|
|
At what point exactly are you calling this function? Are you using dialogs for entering variables' values?
Tomasz Sowinski -- http://www.shooltz.com
To some its a six-pack, to me it's a support group
|
|
|
|
|
Well, this function was originally writen in C with a console user interface. I erased all printf and scanf calls and used dialogs to prompt messages and get input. The function is called inside ON_OPTIONS_INFERENCE.
|
|
|
|
|
It shouldn't have side-effects you've described. I guess you'll have to look for the cause of problems by commenting out parts of the code or inserting temporary return statements.
Tomasz Sowinski -- http://www.shooltz.com
To some its a six-pack, to me it's a support group
|
|
|
|
|
Put a breakpoint in the CMainFrame::OnCreate function. This is where the toolbar and status bar should be created. It should give you more of a clue to why they have gone.
Michael
Programming is great. First they pay you to introduce bugs into software. Then they pay you to remove them again.
|
|
|
|
|
Hi,
I have 2 projects ( project A and B)which use most of the same functions, but there are others which are unique to project A and others to B.
I would like to be able to use a #define to compile Project A with its own functions and then by changing the #define compile project B with its functions. In other words, I would like to avoid defining 2 different projects.
Is this possible?
And how does one do it, both in the header and source code files?
Thanking you in anticipation.
Rui
|
|
|
|
|
You can use #ifdef and friends for conditional compilation. Your other option is to create a library containing common code.
Tomasz Sowinski -- http://www.shooltz.com
To some its a six-pack, to me it's a support group
|
|
|
|
|
I am running numerical code and want to print the results in a scrollable edit box and I want to save this data in an array?
Any ideas?
Kash
|
|
|
|
|
iostreams - check out my articles here on CP.
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Too Vague Kash.
Ask something more specific or give more details.
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
Dear All,
I would like to have 2 different views for a document. Each view to be display one at a time or together using a splitter window at any point of time.
How best should I approach this? I'm open to any new ideas.
I've just started programming and I think my question will be trivial to most of you out there. Thanks very much for taking the time to help me out
Regards,
Chun Te
|
|
|
|
|
If when you say different views you mean, different view classes, then you should use a Splitter Window and create static views, look at MSDN.
Its difficult to create a Static Splitter window which can turn into a single window since the Splitter Asserts if there is only once view. have a look in the Splitter Section of codeproject.. there might be some ideas you can use.
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
I've used this class, ST_SplitterWnd,to do just what you want. I have two views which are the same because the view has a tab control. The dual views allows the user to see two different tabs of data at once, if desired.
It is here on Code Project in the Articles section. BTW, the class has a nice function called ToggleSide() which allows hiding one of the views. Thus, you can add both views and hide one and the user only sees one. But, when the user wants a second view, you just call ToggleSide() again.
|
|
|
|
|
Hi,
I have written a MFC Extended dll.It works fine in Debug mode.In Release mode if i use /MDd it works.But if i use /MD it crashes. Could any one pl tell me why is it happening so?
Thanks
Neha
|
|
|
|
|
You have probably screwed something with project settings. What exactly crashes?
Tomasz Sowinski -- http://www.shooltz.com
To some its a six-pack, to me it's a support group
|
|
|
|
|
A third party dll(IMGSCAN.OCX)loads my dll(It is a TWAIN Datasource).If i use /MD configuration it says access violation in imgscan.ocx .
|
|
|
|
|
You've mentioned in original post that your dll is 'MFC extended'. There are two kinds of MFC-based DLLs: MFC extensions DLLs and regular MFC dll. If you have MFC extension DLL, then it can be used only by .exe which link to MFC as well. If 3rd party module is not using MFC, then you're heading into crashland.
Tomasz Sowinski -- http://www.shooltz.com
To some its a six-pack, to me it's a support group
|
|
|
|
|
It is a MFC extension dll. 3rd party module does uses MFC.
|
|
|
|
|
You mean the program hosting .ocx? Does it link dynamically with MFC?
Tomasz Sowinski -- http://www.shooltz.com
To some its a six-pack, to me it's a support group
|
|
|
|
|
I don't have the code for host application.So i don't know anything. Also it works fine, if i link my MFC dll using static library.
|
|
|
|
|
The rule is quite simple: you can create MFC extension .dlls *only* if client app (the OCX host in your case) is linking dynamically with MFC.
Seems you'll have to switch to regular DLL or link statically.
Tomasz Sowinski -- http://www.shooltz.com
To some its a six-pack, to me it's a support group
|
|
|
|
|
If i switch to regular dll also i will get that problem.
Any idea?
|
|
|
|
|
If you switch to regular DLL then your .dll interface must be C-style, e.g. no MFC objects passed around --and-- each exported function must have AFX_MANAGE_STATE macro.
Tomasz Sowinski -- http://www.shooltz.com
To some its a six-pack, to me it's a support group
|
|
|
|