|
thanks you, disabling /Wp64 switch worked for me
|
|
|
|
|
I have a very simple question.I speficy the source files for a program in makefile as follows
PROGRAM = sq.exe
all: $(PROGRAM)
########### list of C++ source files
CPPSRCS = \
main.cpp
.......
........
########### build a list of all .obj files
OBJS = $(CPPSRCS:.cpp=.obj) $(CSRCS:.c=.obj)
########### how to link .obj files to create an executable
$(PROGRAM): $(OBJS)
$(link32) -out:$@ $(OBJS) $(LIBS) $(linkflags)
Now in case i have a large number of source files - how can i specify at directory level - viz. all cpp files under directory 'source'?
|
|
|
|
|
I want to be able to automatically install some driver files for use by my application. I have looked high and low and cant find any API documentation to help me out. Does anyone know of a way?
|
|
|
|
|
You can use ShellExecute() or CreateProcess() with devmgmt.msc.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Sorry to be such a pain. Can you eleborate a little? I have used both these functions in the past but how on earth would I use them to prompt the device manager to install some drivers from a particular location?
|
|
|
|
|
My reply was simply in response to the "Launching Device Manager" subject. It obviously could not be used to install devices/drivers.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Thanks David.
|
|
|
|
|
I want to be able to prompt the Device Manager to install some driver files from a specific location from C++.
|
|
|
|
|
Do those driver files have a setup/install program?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
No.
They are custom drivers that have been written for our specific hardware. I have looked high and low for information on it. Im sure its possible but MSDN doesn't have all that much information.
The Linux world makes it so much easier
|
|
|
|
|
Maybe devmgr.dll has some exported functions (e.g., DeviceCreateHardwarePage() ) that can be used.
http://www.experts-exchange.com/Programming/Q_20617785.html[^]
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
Hi,
I have a program that has a commandline option to pass a user and a password. If I start this program from within another windows program using CreateProcess, can dodgy types get hold of this commandline?
|
|
|
|
|
If it's a string literal, yes.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Someone could fairly easily view all the string literals in your .exe file. Alternatively they could replace the EXE that you are launching via CreateProcess and they could display the command line from their EXE.
|
|
|
|
|
The Process Explorer[^] utility can show the command line that any process (to which you have access) was launched with. I think it does this by using the ReadProcessMemory API. By default, processes have ACLs (security settings) set so that only the creator of the process can use this API, but this behaviour can be overridden with use of the Debug privilege, which Administrators have by default - and as we all know, most people log in to Windows as a member of the Administrators group.
|
|
|
|
|
sadly I'm talking not about advanced compiling options but fonts, background colours and the like. I realise that this is something that probably comes over time as a personal preference, but wondered if anyone had any good links on a good start. I used to have one set up when I worked in programming with black background code windows and certain keywords all coloured in to make it easier to spot types and stuff.
I'm sure someone has good info, links or advice. gratefully received
cheers
Lee
|
|
|
|
|
I use the default with a few minor changes. Red/white for numbers; Blue/white for keywords; Green/white for comments; White/blue for string literals. Black/white for all else.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi,
i needed to change the position and rotate a GIF image in given angles as per user inputs in a MFC application .
So I started to use Image object in GDI+.My intention was to make a Image object and manupulate its position and orientation.(As given in msdn page titled Drawing, Positioning, and Cloning Images - refer the link below)
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdicpp/GDIPlus/AboutGDIPlus/IntroductiontoGDIPlus/OverviewofGDIPlus.asp[^]
I tried to insert a image to my main frame using "Image" in GDI+. But a runtime error (unhandled exception) is occuring when im going to run the program.The details are as follows.
I have included "gdiplus.h" in StdAfx.h. There were no issues on that.But the problem started when i tried to insert a image using the guidelines given in above msdn link(.Drawing, Positioning, and Cloning Images - GDI+)
As per that method I used the following code:
CPaintDC dc(this);<br />
Graphics myGraphics(dc.m_hDC);<br />
<br />
Image myImage(L"robot.gif");
myGraphics.DrawImage(&myImage, 20, 10);
The program Built & compiled successfully in VC++ 6.0.But didn't run.It gaves a error.
When I insert that code to a .NET project the error message says that ;"Unhandled exception at 0x7c9105f8 in tttdk.exe: 0xC0000005: Access violation reading location 0x00000010."
When I break it , it shows the location of the error in the following cpp file.
D:\VS\VC\atlmfc\src\atl\atls\allocate.cpp
<small>..<br />
<br />
...<br />
<br />
CAtlTraceCategory *CAtlAllocator::GetCategory(int iCategory) const<br />
<br />
{<br />
<br />
if(iCategory == m_pProcess->CategoryCount())<br />
<br />
return NULL;<br />
<br />
<br />
<br />
ATLASSERT((iCategory < m_pProcess->CategoryCount()) || (iCategory == -1));<br />
<br />
CAtlTraceCategory *pCategory = NULL;<br />
<br />
if(iCategory >= 0)<br />
<br />
{<br />
<br />
BYTE *pb = reinterpret_cast(m_pProcess) + m_pProcess->MaxSize();
<br />
pCategory = reinterpret_cast(pb) - iCategory - 1;<br />
<br />
}<br />
<br />
return pCategory;<br />
<br />
}<br />
<br />
..............</small>
Please help me regarding the above matter ASAP.or else tell me way to Insert a GIF image to a MFC frame and to change its position and rotate by given angles time to time.
Thisara
ENTC
UoM
|
|
|
|
|
Just a shot-in-the-dark:
Based on your code line alone:
BYTE *pb = reinterpret_cast<???>(m_pProcess) + m_pProcess->MaxSize();
Is MaxSize by any chance the fourth virtual method in m_pProcess? Do you have a memset(m_pProcess, 0, sizeof(...)) or equivalent somewhere? If so I think you are zeroing out the vtable. You can't use memset on a class with virtual methods.
Based on the code above that is the only thing I can think of that would make it crash.
---
Dhananjayak02 wrote: The program Built & compiled successfully in VC++ 6.0.But didn't run.It gaves a error.
What error?
Mike
|
|
|
|
|
Dear Mike,
Thank u very much for attending this matter.Actually I dont know what is error that comes when im runing the application.
There appears a window asking whether to send the error report to Microsoft. I tried to see the technical information in that report.But can't understand.It states about an exception. The appilication error states that the memory could not read at a location(memory address was given)
When I debug it following appeared..
Loaded symbols for 'D:\_Thisara\GDIplusProjectTDK\Debug\GDIplusProjectTDK.exe'
Loaded 'C:\WINDOWS\system32\ntdll.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found.
Loaded symbols for 'C:\WINDOWS\system32\MFC42D.DLL'
Loaded symbols for 'C:\WINDOWS\system32\MSVCRTD.DLL'
Loaded 'C:\WINDOWS\system32\gdi32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\user32.dll', no matching symbolic information found.
Loaded symbols for 'C:\WINDOWS\system32\MFCO42D.DLL'
Loaded 'C:\WINDOWS\system32\ole32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\msvcrt.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\advapi32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\rpcrt4.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.Windows.GdiPlus_6595b64144ccf1df_1.0.2600.2180_x-ww_522f9f82\GdiPlus.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\comctl32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\uxtheme.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\version.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\shlwapi.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\apphelp.dll', no matching symbolic information found.
The thread 0x620 has exited with code 0 (0x0).
The thread 0x9C8 has exited with code -1073741819 (0xC0000005).
The program 'D:\_Thisara\GDIplusProjectTDK\Debug\GDIplusProjectTDK.exe' has exited with code -1073741819 (0xC0000005).
ENTC
UoM
|
|
|
|
|
Right - that is to be expected! That information says exactly the same thing as your OP.
> The thread 0x9C8 has exited with code -1073741819 (0xC0000005).
0xC0000005 is the code for an access violation. I refer you to my previous post - what is m_pProcess? One of your classes? Or a library class? If so, which library and what's its type? CProcess? Check to make sure you aren't memset-ing m_pProcess to zero anywhere.
Mike
|
|
|
|
|
|
plz kindly help me
#sanroop#
|
|
|
|
|
look at the Shell_NotifyIcon() API. You can add an icon, then later modify it using this API.
|
|
|
|