|
Thanks for the advice. It does make testing faster, certainly in the "false" cases when no CD is present in the drive.
|
|
|
|
|
From my Win xP station where I have connected USB printer, I am not capable to print from my dos application. How can I Do to print to my USB Printer from DOS Application.
I learn my self
|
|
|
|
|
You will have to do a "Net Use LPT..." type command to establish a correlation between a DOS-accessible device and the printer device name. This needs to be done either as a shell command prior to startup of your app (IE: batch file startup) or as part of a custom DOS box with special autoexec.bat.
onwards and upwards...
|
|
|
|
|
I'm trying to find the best way to update my CView's when information in my CDocument changes. Right now I'm using the following method:
CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;<br />
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();<br />
CAESView *pView = (CAESView *) pChild->GetActiveView();<br />
<br />
pView->SendMessage(UWM_UPDATE_VIEW, 0, 0);<br />
This works fine but it only updates the active view. How can I update all views that are related to the document, whether they are active or not?
Thanks.
|
|
|
|
|
|
Thanks Cedric. I didn't realize it was that simple. It was not mentioned in any book I have. I guess I need to buy some new books!
|
|
|
|
|
hi i'm currently making a small game,using SDL libraries for graphics(i know its old but its easy), but if i compile the program, with VC6 , and try to run it on other machines it needs some dll's. ("sdl.dll" "msvcp60.dll" "MSVCP60D.dll" ...) the list goes on, i understand why it would need the SDL.dll but the rest...
is there a way to compile it so it wouldn't need anyother files except the exe?
-- modified at 8:53 Monday 15th May, 2006
|
|
|
|
|
These dll's are needed (they contain for example the C run-time library, ...). In order to see which dll's are required for your executable, you can use the Dependency Walker[^] (it's also supplied with VC6, look for depends.exe).
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
And you try using the dependency walker after you move your application to Release mode. It'd further reduce the dependencies. for example those ending with "D" like MSVCP60D.dll .
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[V]--
[My Current Status]
|
|
|
|
|
Grimes wrote: "msvcp60.dll" "MSVCP60D.dll"
As others have said, this is part of the c runtime, you need them.
Grimes wrote: is there a way to compile it so it wouldn't need anyother files except the exe?
Yes, this is called 'statically linking'. What you're doing now is 'dynamically linking', that's why you need these Dynamic Link Libraries (.dll's). When you statically link, you're basically inserting the contents of the library into your .exe file. Your file will be bigger, but it won't need the DLL's. To statically link to the CRT in VC6:
- Select Project, Settings (or press Alt+F7)
- Select the C++ tab
- In the 'category' combo, select 'Code generation'
- In the 'use run-time library' combo, select any of the items that don't end with DLL.
- Say okay, save and build.
If you look at the exe file produced in depends.exe you will notice that the CRT libraries are not required. You will still see other dependencies, like kernal32.dll etc. - these are part of the Windows OS - they will be on your target machine.
Which run time option should you select from that last combo? For debug builds, select 'Debug multithreaded', for release builds select 'Multithreaded'. I suggest this as your working on a game - so I'm guessing your using threads.
Are you using MFC? If you are, then you must statically link to MFC if your going to statically link to the C runtime. To do this, bring up the Project settings dialog again, and on the general tab, select 'Use MFC in a static library' from the MFC combo.
Hope this helps. BTW: I'd recommend dynamic linking, it means you don't need to do any of the above - just distribute the required libraries with your EXE.
- Dy
|
|
|
|
|
Thanx you guys really helped alot, it seems to be working great!
|
|
|
|
|
Hi,
We have developed an application contains server and client.We connected this two with sockets in out network.
But we have to develop this in remote connection,i.e,through internet.So,pls can u help me?
Whats the procedure?
Any tutorial available?
|
|
|
|
|
|
Hi,
Thnks for your reply.
We developed the application in sockets.
I asked that how the server and client get connected through internet.
|
|
|
|
|
|
It looks like you can make a key under HKEY_CLASSES_ROOT\Applications with your DLL's name, then below that create a shell\open\command subkey whose default value is the command-line to run.
IE (iexplore.exe), Firefox (firefox.exe) and Visual Studio (devenv.exe) all seem to do this, for example.
Below the filetypes themselves there's just an OpenWithList key which has empty sub-keys with the EXE/DLL names which correspond to the Applications sub-keys mentioned above.
Hope that helps!
|
|
|
|
|
I've got a Win32 (no MFC, ATL etc.) DLL project which I recently moved from VS2003 to VS2005.
Of course, the first step was to take care of the compilation errors/warnings, mainly due to deprecated functions and the new "secure CRT", which I simply #defined away for now because much of the code is 3rd party graphics libraries I don't want to extensively modify. The code now compiles fine with no errors and no warnings.
The problem is that when I run my DLL it crashes in apparently random places and in different parts of the project which have very little in common. For example, I had a crash within a dialog's window procedure and another similar crash inside library code (also compiled by me in VS2005) which loads an image.
In the dialog proc's case I was able to "fix" the bug by refactoring my huge dlgproc into several smaller functions. (I could also "fix" it by commenting out the lines where the crash occurred but it's interesting to note that the crash still happened if I changed those lines to send a WM_NULL to the dialog.) The dialog crashes were occuring around the time of recursive calls to the dlgproc, and under a debugger the crash in both the dialog and the image library were generating a "stack overflow" message. But I don't buy this as the real cause because there are very few functions and very little data on the stack and the code is not in an infinite loop, worked fine under VS2003 and indeed works if I refactor the code in a way which ads *more* call data to the stack, not less. The recursion level is 3 calls deep, if that.
I sent the code to a friend who has BoundsChecker and he said it couldn't detect anything wrong with it, but he could still reproduce the crash.
This has been driving me nuts and wasted a lot of my holiday time that I wanted to spend actually making cool stuff. I wonder if anyone has experienced anything similar and has suggestions on where to look? It feels like a compiler error or a stack corruption issue rather than a genuine stack overflow.
Has anything changed in the way VS2005 deals with the stack? I haven't touched any project settings after converting from the VS2003 project, but I read that the default stack size has been increased from 64k to 1meg. Maybe there's a problem when DLLs are called from non-VS2005 programs and the VS2005-generated code is assume 1meg of stack has already been reserved or something? I'm clutching at straws really... (Writing a test harness for the DLL in VS2005 is on my list of things to try but that list is long, my holiday is over, and the whole ordeal has left me quite frustrated! So I'm hoping someone has some good advise.)
Thanks for reading and any help!
|
|
|
|
|
I would suspect heap corruption. Try enabling the page heap. How to do this:
1. Download WinDBG from Microsoft here[^].
2. Install it.
3. Select "Start Menu->Programs->Debugging Tools for Windows->Global Flags".
4. Select the "Verifier" tab.
5. Enter the name of your EXE in the "image" edit box and press TAB. e.g. "Notepad.exe".
6. Tick "Enable" & "PageHeap".
7. Press "OK"
Run you application. It will run many times slower then normal and consume much more memory. In some cases I have been unable to run a particular application as my machine didn't have enough memory; you may need a beefy machine for this kind of debugging.
Don't forget to turn off the page heap when done. To do this enter the EXE name, remove the options we added and press OK. Let me know if you have any questions along the way.
Steve
|
|
|
|
|
Thanks Steve, it's definitely worth a try!
|
|
|
|
|
HI,
I want to create a Windows service that runs at the windows startup and invisible from the user , and perform the functionalty of Listening on a given Socket.
How can I create it ?
Thanks
Regards.
|
|
|
|
|
zahid_ash wrote: I want to create a Windows service that runs at the windows startup and invisible from the user
Create a new ATL Project. In the Project Wizard under Application Settings/server type, choose "Service (EXE)".
zahid_ash wrote: perform the functionalty of Listening on a given Socket.
Sockets.com[^]
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum
led mike
|
|
|
|
|
Could you please give me link or code snip which explains the development of "new ATL Project. In the Project Wizard under Application Settings/server type, choose "Service (EXE)"."
Thanks again
Regards.
|
|
|
|
|
|
Hi All,
how can I get information regarding scrollbar needed or not. i need to show scrollbar only if there are more items to scroll. how we can implement this in a owner drawn listbox?
Currently I am working as software engineer at Network System Technologies Pvt. Ltd (NeST). Most of my project are in C++. Most interesting are is GUI programming.
|
|
|
|
|
If you are using CWnd as parent I think that you could use:
SCROLLINFO Info;
GetScrollInfo(SB_VERT,&Info);
//Some corrections like:
Info.nPos=0;
Info.nPage=Info.nMax;
Info.fMask|=SIF_DISABLENOSCROLL; //Don't hide the scrollbar (but it will be disabled)
//Else the scrollbar will deleted
SetScrollInfo(SB_HORZ,&Info);
|
|
|
|