|
|
Its the answer to my other question
do u know anything about compiler
setting in vc++
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com`
|
|
|
|
|
vikas amin wrote: How to do the option setting for complier
What version of Microsoft Visual Studio are you using?
Assuming you are using Visual Studio 6.0, I am giving you a solution.
1. Click on Project menu.
2. Click the Settings menu item.
3. Choose the C/C++ Tab Item.
4. Choose "Optimization" from the Category ComboBox.
5. You will find a new ComboBox, named "Inline Function Expansion"
6. Set your desired setting there.
Regards,
Rajesh R. Subramanian,
Akruti Software,
Bombay, India.
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
If my Dll fails to load into the EXE, the EXE will still start if doesnt have dependencies on this Dll. What can I do in the Dll to prevent the EXE from starting if the Dll initialization fails and the Dll doesnt load into the EXE?
thanks!
|
|
|
|
|
You're thinking of DLLs that the OS image loader loads when starting up a process. If a DLL is missing but the EXE starts anyway, it means the EXE is not statically linked to any exports of the DLL. Therefore, to make the EXE not load, you need to add a call to one of the functions that the DLL exports.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
"Just because the box has 2 gigabytes of memory doesn't mean you get to use it all!"
-- Rico Mariani, CLR perf guy
|
|
|
|
|
If the dll fails to load, then no code is run in the dll. There is absolutely nothing that can be done from the DLL side.
If the exe fails to load a dll, but still runs, then it has done one of two things: 1) delay loaded the dll in question, which means it only loads the dll when a function from the dll is called, or 2) the dll in question is loaded manually thru LoadLibray and functions are retrieved thru GetProcAddress.
So, if you have code to the exe, then you can change the behavior of what happens when it fails to load, otherwise you're pretty much out of luck.
--
Joel Lucsy
|
|
|
|
|
Thanks for the responses. I have no control over the EXE, only the DLL.
I suspect, in my case, something is going wrong in the ProcessAttach that the loader decides to not load the DLL but continue the EXE. is this possible?
I am going to put a try/catch aroung ProcessAttach contents and do a ExitProcess in the catch. Will this work? The problem is not easily reproduceable, so I will have to wait and watch for some time.
thanks!
|
|
|
|
|
I am trying to incorporate headers from one program into another. The host program compiles fine until I add my stdafx.h which includes:
#include afxwin.h // MFC core and standard components
#include afxext.h // MFC extensions
#include afxdisp.h // MFC Automation classes
#include afxdtctl.h // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include afxcmn.h
//(syntax edited for posting)
it then generates errors such as these in which there seems to be an ambiguity between winsock.h and winsock2.h:
c:\Documents and Settings\Brenaman\Desktop\UAV Simulator\use\SourceCode\use_ios\Globals\globals_socket_ext.h(13): error C2146: syntax error : missing ';' before identifier 'socketData'
c:\Documents and Settings\Brenaman\Desktop\UAV Simulator\use\SourceCode\use_ios\Globals\typedefs.h(41): error C2501: 'gameport::capability' : missing storage-class or type specifiers
c:\Documents and Settings\Brenaman\Desktop\UAV Simulator\use\SourceCode\use_ios\Globals\globals_socket_ext.h(15): error C2501: 'recvSockAddr' : missing storage-class or type specifiers
I've tried various things:
#define _WINSOCKAPI_ in various places to disinclude winsock.h in windows.h.
Editing windows.h to include winsock2 instead of winsock.
Various #include sequences.
However, I changed the names of the winsock headers and discovered that they are not even used by the program I am trying to incorporate headers from. The host program uses Standard Microsoft Libraries while the other seems to use MFC. Could this be the problem and if so, is there a way around it?
Thank you in advance for any help.
- Chris
|
|
|
|
|
Hello,
Where are you adding your stdafx.h file? Did you overwrite the stdafx.h from the host program? What kind of application is the host program? Is a DLL or a normal GUI application?
There is a way around this problem. I typically write DLL's if the code is to be used by an other application. You can almost flawlessly integrate the code with your other app...
Hope this helps.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Thank you for your reply! I am quite a newbie taking on a project a bit over my head so here it goes:
I am adding the stdafx.h file in a .cpp file that samples the UAV state. I did not overwrite the stdafx.h in the Release folder (perhaps that's what I need to do?). The host program is a UAV simulator GUI program. The headers I'm trying to insert are for a vibrotactile vest. This will give pilots additional guidance cues.
Your DLL approach sounds like the way to go. Could you explain how you do this a little more? Thanks again.
|
|
|
|
|
Hello,
The sole purpose of the stdafx.h is to speed up compilation by precompiling the headers that you include. One simple solution might be to include the headers you need directly and do not use stdafx.h. See what that brings you.
I assume that you know what DLL's are. If you can redesign your applications, you can group the simulator API and compile that into a DLL. A search here on CP for DLL brings you, among others, the following articles:
Regular dll Tutor For Beginners[^]
DLL's are simple 1[^]
DLL's are simple 2[^]
DLL's are simple 3[^]
DLL's are simple 4[^]
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Thank you again for your reply and the refs to DLLs. Sorry for my ignorance -I didn't really know what they were. After reading about them, I've come up with a plan:
1. The host program (executable) can export the UAV status to the DLL (cyclically)
2. The DLL is run with each call to it and can then control the tactile vest (as the execuatable sends the status)?
My assumption is that, in this situation, the DLL is like a separate execuatable but yet an included piece of code, in one (thus eliminating my library conflicts and other integration problems). Does this seem right? Thanks again.
|
|
|
|
|
Hello,
I don't know if it's wise to spawn threads in a DLL. (Are you doing this?). Your library conflics are resolved if you use the DLL approach.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Thanks for your reply. I guess it would be a DLL spawning a thread which would terminate with the signal sent to the tactile vest (although the vest requires the use of a killable timer as well). Are there some serious processing issues in this?
|
|
|
|
|
Hello,
I don't know if there are serious issues since I don't know the context. If you spawn the thread often and kill it often, you might have troubles since thread creation is an expensive operation.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Hi people,
I want to use the CTreePropSheet (by Sven Wiegand). I have a group of dialog boxes, say dialog 1, dialog 2, dialog 3. These dialogs have controls in them too, there are actions to be perfrmed based on events of those controls. Sven Wiegand has beautifully explained things out there. But I still dont understand how to do what I want. Can anyone please explain me how to do this (Step by step)? Your help is highly appreciated. Thanks a lot in advance for all of you PRO's. (Actually i've been doing a lot of C++ and not anything great in MFC, I am new)
Regards and thanks,
Rajesh R. Subramanian
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
I found out the answer myself.
After adding the required files to my project, I must make sure that my dialog boxes which has controls and which has to be added to the tree control should be derived from CPropetyPage instead of CDialog.. That's it.
Regards,
Rajesh R. Subramanian
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
I hope I am not asking too much.
Using an image list, I want to place some images into controls. I've got an image strip of 32x32 bitmaps - 5 of them. Upon loading these images and showing them, they are getting reduced to 8bit images. They are in my resources.
Why doesn't this work?
CBitmap ImageStrip;
ImageStrip.LoadBitmap( MAKEINTRESOURCE(IDB_DESKTOP2) );
HIMAGELIST hList = ImageList_Create( 32, 32, ILC_COLOR16, 5, 5 );
ImageList_Add( hList, (HBITMAP)ImageStrip.GetSafeHandle(), (HBITMAP)NULL );
CImageList ImageList;
ImageList.Attach( hList );
m_Grid.SetImageList( &ImageList );
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc.</A>
|
|
|
|
|
or this....
CBitmap ImageStrip;
ImageStrip.LoadBitmap( MAKEINTRESOURCE(IDB_DESKTOP2) );
CImageList ImageList;
ImageList.Create( 32,32,ILC_COLOR16,5,5);
ImageList.Add(&ImageStrip,RGB(255,255,255) );
m_Grid.SetImageList( &ImageList );
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc.</A>
|
|
|
|
|
Add ILC_COLORDDB to the flags, I see weird color problems sometimes when I don't use that flag.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
Kosh reminded me of some of the prima-donna programmers I've worked with. Knew everything but when you asked them a question; never gave you a straight answer.
-- Michael P. Butler in the Lounge
|
|
|
|
|
Sir
can anybody pls help how to load a menu in one of the pane of a Splitter Window. if view is divided in (0,0)and (0,1)
and i want to load Menu into (0,0) pane. Thank u. bye
Satishvarma.E
|
|
|
|
|
|
|
Sorry, no. The last version that could was VC++ 1.52, available (but no longer supported) via a MSDN subscription.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|