|
vipin_nvk wrote: Is the .exe generated by VC++ IDE also dependent on the PC on which the application has been developed?
This is the key point and the answer is, it can be, in at least the following ways.
1. Installed SDK. The code you develop on your Win2K PC will be diferent depending on what version of Visual C++ and what version of and SDKs are installed. These will effectively change your source. You can update these to versions capable of build XP apps if they are not already.
2. Test platform. The code you build on the Win2K PC may work there against the Win32 API verion available there but that does not automatically gaurentee it will work against XP. Remember that every Win32 application loads up Dlls that are part of Windows from the machines where it's installed and then makes hundreds of calls into these Dlls. If one function is missing, or perhaps behaves differently then things can go wrong.
Two points to note in your specific case.
1. The reason for the failure may not actually be the Win2K vs XP differences it could possibly be just the general difference between the two machines although with the error you're getting this is unlikely.
2. The requirements and environment for Services in particular are very Windows version specific. It may be that your Win2K developed service does not do all the things or meet all the timings required by an XP Service. MS tightens things up in security for example with each release.
With all that in mind in the end it could be as simple as which value of the _WIN32_WINNT you've compiled with. Unless you set this to at least 0x0501 I wouldn't expect the service to start on XP.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
I Am Using MFC Application.
How Can I Get The Handler Of Click Event From My Desktop?? I Want To Get The Message Of The Mouse Event In My Window Procedure Method.
Plz Reply If U Get Some Solution..
Thanks
|
|
|
|
|
If you can capture the mouse (see SetCapture) then all the mouse messages will be obtained to your window through OnLButtonDown, OnLButtonUp, OnMouseMove, etc.
If you cant use a mouse hook. You will get enough articles here in CP regarding this.
- NS -
|
|
|
|
|
If you need to get the mouse messages without affecting its functionalities, you cant capture the mouse. That means if you capture the mouse then all the events will be towards you. You cant click anything in another window.
ashishbhatt wrote: And From Your Reply...........
If you cant use a mouse hook. You will get enough articles here in CP regarding this.
Actually I meant, "If you cant do a mouse capture, then use a mouse hook" And CP means CodeProject.
- NS -
|
|
|
|
|
Hello ,
I have tried with SetCapture() function , it works but it gives message only at first time i click on the desktop (or client Area which i have created as window using WNDCLASSEX and CreateWIndow()) and then i click on the disktop that msg does not come or my procedure does not catch it.
I am using window procedure to catch the message.
Plz Reply me.
Thanks....
|
|
|
|
|
Can you explain your purpose?
- NS -
|
|
|
|
|
Hi,
Let me explain in detail.
I have taken my MFC application.. OK. In that I have taken one Simple Class with diff .cpp and .h files(RTMPDesk.cpp). In this class I want to check that whenever click on desktop or any other client area than that message should be catch by Application.So, for that i created on window using WNDCLASSEX structure and Createwindow() function.And I catch messages in Window Procedure which i have created in RTMPDesk.cpp file.
So , iget only one time whenever i click on that created window.I want to check it for every time wenever i click on window.Ok....
I hope everythig is clear.
Plz help me.
Ashish
|
|
|
|
|
OK... my doubt is that whether you want to block the mouse click to other windows when your application is running? Or only you need to get the event, but the other applications should get the click as usual?
For the first case, you can make a top level transparent window which covers the whole desktop, so all the mouse events will be sent to this transparent window.
For the second case, AFAIK, only mouse hooking is a solution.
- NS -
|
|
|
|
|
Hi everyone...
totally clueless abt how to write a C++ program to return the RGB values of an image!! Can anyone help?
|
|
|
|
|
CDC::GetPixel <br />
COLORREF GetPixel( int x, int y ) const;<br />
COLORREF GetPixel( POINT point ) const;<br />
or
<br />
::GetPixel ()<br />
COLORREF GetPixel(<br />
HDC hdc,
int XPos,
int nYPos
);<br />
will help you
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Thanks...
How to implement this function in a program to read pixel values from a bmp image(eg. purple.bmp)?
Is it ok for you to show me a sample of how this works?
With regards,
Purplee
|
|
|
|
|
To make an example would be large and, actually, your work.
Try it and post when you have problems, start looking in the codeproject and google, there are examples for sure.
Good luck
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Hey,
I have a for loop iterating through a Vector. When my program hits certain conditions it needs to do get the value of an element and add one to it.
I tried this but it didn't work:
PrimeNumber(Iter + 1) += 1;
It has to be the next element in the vector and it has to increment that next elements value by one! I've tried declaring an Iterator and using similar code -> *Iter + 1 += 1; but that still doesn't work
Does anyone have any ideas on how to modify the content of a vector? Thanks for all the help in advance I appreciate it!
Michael
|
|
|
|
|
Michael101 wrote: using similar code -> *Iter + 1 += 1; but that still doesn't work
*(Iter + 1) += 1;
Nibu thomas
MVP For VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http:\\nibuthomas.wordpress.com
|
|
|
|
|
You Champion!
|
|
|
|
|
Make sure you don't go beyond/access vector<>::end() when doing +1.
Nibu thomas
MVP For VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http:\\nibuthomas.wordpress.com
|
|
|
|
|
Hello,
How can I attach child window's caption to the frame window in the OnSize() Function?
Right when I maximize the child window it gets maximized without actually the caption getting merged with te frame window.
This is the code in the OnSize()
switch(nType)
{
case SIZE_MAXIMIZED :
{
CRect R;
GetParentFrame()->GetClientRect(R);
MoveWindow(R,true);
break;
}
}
Regards
Prithaa
|
|
|
|
|
prithaa wrote: Right when I maximize the child window it gets maximized without actually the caption getting merged with te frame window.
It's already being done for you if you are using DocView architecture by MFC.
Nibu thomas
MVP For VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http:\\nibuthomas.wordpress.com
|
|
|
|
|
Hello,
Thanks.
No I am nt using Doc -View Architecture and the caption doesn't get merged with the frame window.
What should be done?
Prithaa
|
|
|
|
|
Take a look in BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs) . There is where I defined the captions for the "seconday views" on my project.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Hello,
Thanks for your reply.
I have the caption initially when the window is created but when I maximize the child window the caption does not appear alongwith the frame window .
What should be done?
Prithaa
|
|
|
|
|
When you maiximize a chil window, it loses its own caption, and share the main frame caption, another thing is to fit the child window to the whole client area of the parent, but maximizing... nothing to do.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
I want to know How Winmain() functions working nature. Also, I want to know from where it is get called?
Sethuraman.K
|
|
|
|
|
Sethuraman.K wrote: I want to know How Winmain() functions working nature. Also, I want to know from where it is get called?
The call stack when execution reaches WinMain is as follows..
WinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00000000, char * 0x00141f09, int 1) line 27
WinMainCRTStartup() line 330 + 54 bytes
KERNEL32! 7c816fd7() Press F10(I am using VC6) to see how execution starts in an MFC application. Step through the code. Don't forget there is a global CWinApp object too.
Nibu thomas
MVP For VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http:\\nibuthomas.wordpress.com
|
|
|
|
|