|
I added TRACE0 in this function
|
|
|
|
|
Well, check the documentation[^]. TRACE0 does nothing in release mode.
|
|
|
|
|
Hi, i'm writing a dll for another program
i'm basically having difficulty getting the correct client rect (where x is few pixels to the right of the window x and y is below the border) of a window that i have a handle to
i'm currently using GetWindowInfo
here's the code
WINDOWINFO wi;<br />
<br />
wi.cbSize = sizeof(WINDOWINFO);<br />
<br />
GetWindowInfo(window_handle, &wi);
when I debug the dll the values of the client rect in wi aren't correct
the window isn't created with my dll, but i'm pretty sure i've got the right window handle
how do i get the correct client rect of a window, am i doing something wrong ?
thanks
|
|
|
|
|
Use GetWindowRect() function.
dimensions in screen coordinates.
|
|
|
|
|
thanks, i don't think my c++ is the problem, i must have the wrong hwnd or something, when the window's fullscreen i can get the width and height but when it's windowed, the rect appears with uninitialized values. it's game maker i'm trying to get the client rectangle for so there's probably someone in the gm forums that knows what's up
|
|
|
|
|
doug25 wrote: when I debug the dll the values of the client rect in wi aren't correct
So what is GetWindowInfo() returning?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
found the problem , i was getting the wrong window handle after all. i thought the program just used one window but the handle changes when fullscreen / 3d mode is toggled or something like that so i'm required to pass the new handle to the dll. i was getting uninitialized values in the window info stucture when i changed between windowed and fullscreen mode. now it's working ok
thanks
|
|
|
|
|
Hi all,
I am new to Microsoft Visual C++ 6.0 development environment.
So i want to do a simple application which takes the User name as a user input. and process it.
How can i do it in Win32 Application
Please some one provide me some links or samples.
Thanks in Advance.
|
|
|
|
|
Hi,
One way is to accept the string(s) as command line parameter(s) and then use GetCommandLine()[^] to retrieve the command line parameters and then process them.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Hello All,
I have a dialog derived from CDialog. Whenever I uses a groupbox, its title and boundary line is getting overlapped. Usually boundary line will not be present below title. In my case, under title boundary line is also visible.
Please help me to resolve this issue.
|
|
|
|
|
Hello,
I'm pulling my hair out trying to figure this one out. I received some native C++ code from a colleague and compiled it under VS2005. I used the Win32 configuration,and it works fine on Windows 32-bit. However, this same app fails on x64 ("Application is not a valid format"). SO I tried compiling for x64 and running it, and it fails on BOTH 32-bit and 64-bit! I following Microsoft's directions here[^], but I still get the same error. I have the 64-bit tools installed, so what am I missing? Do I have to compile this from the command line instead of from the IDE?
Any suggestions are appreciated.
Thanks,
Dybs
The shout of progress is not "Eureka!" it's "Strange... that's not what i expected". - peterchen
|
|
|
|
|
Any 32-bit app should work on 64-bit windows without any changes.
Exactly what goes wrong when you run the 32-bit version of the app on x64?
|
|
|
|
|
Richard Andrew x64 wrote: Any 32-bit app should work on 64-bit windows without any changes.
That's what I thought. It's just a simple stand-alone console app. When I try to run it, I get the error message The application is not a valid format or something to that effect. I don't remember the exact wording right now, but I can post it when I get to work in the morning.
Dybs
The shout of progress is not "Eureka!" it's "Strange... that's not what i expected". - peterchen
|
|
|
|
|
Richard,
The exact error message I get is
"This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem."
I can't really "reinstall" it since it's a standalone exe. Like you said, I thought any 32-bit program would at least run on a 64-bit system. Any ideas?
Thanks,
Brandon
The shout of progress is not "Eureka!" it's "Strange... that's not what i expected". - peterchen
|
|
|
|
|
Hi Brandon,
That error usually means that the Side-by-Side (SxS) runtimes have not been installed.
Make sure you install the runtime libraries for your application.
If you go to your "redist" folder inside your Visual Studio tree, you'll find the redistributables for C++ and MFC. Install those onto the target machine, and it should work.
|
|
|
|
|
Hi
I made some simple program..it sometimes die...
so I'd like to know the line number which line cause problem and die.
so, is there macro or function to find out died line for VC6.0?
Thanks.
|
|
|
|
|
die?? did you mean crash?? if that is the case then i think you should debug the code and find out where it is crashing
|
|
|
|
|
|
|
Do you know from which method it is crashing? Does your methods have exception handlers?
One lazy way->
try{
int nLine = 1;
nLine = 2;
nLine=3;
nLine=4;
}
catch(...)
{
}
-Suhredayan
|
|
|
|
|
In short : I'm having trouble trying to figure out to convert any base number{2-36} to base 10 in C++.
Really, I'm supposed to design a program that can take in any InBase number(2-36) and convert it to any OutBase(2-26) by use of a stack.
As a solution and probably a inefficient one, I thought I would convert the InBase first to a base 10 number and then reconvert to whatever chosen OutBase.
Psuedo or the actual code is much appreciated but really, I need an good explanation on how I could implement this way of conversion.
I'm using Visual c++ 2008 express edition to code the program.
Thanks in advance.
|
|
|
|
|
The formula for converting to base 10 is (base^n * dn) + ... + (base^2 * d2) + (base^1 * d1) + (base^0 * d0) read as base to the power n into dn
where d0 is the left most digit and dn is the right most digit and base is the base value using which the number is currently encoded.
Once you get the base 10 value you can convert it to any other base between 2 - 36 using the _itoa_s .
|
|
|
|
|
Sorry for the late reply.
Thank you very much for your help!!
|
|
|
|
|
I can't see any examples of this function. I was hoping if answered the following issue below...
I have been asked to have arrow keys work in the microsoft C++ Ribbon bar like they do in Microsoft Word 2007.
Press F10 in Microsoft Office and then hit the arrow keys and it will move the user across the categories. When I do this in the microsoft demo, it doesn't do this.
|
|
|
|
|
Hi,
I'm reading a file straight in to a CRichEditCtrl, butI am not getting any justification maintained.
The rtf file has been created in Microsoft Word, and is fully justified (to fill the screen etc), but when I read the file in to my control each paragraph just appears as a single line.
I have tried using SetParaFormat but it seems to make no difference.
My PARAFORMAT2 is configured as below
<pre>
PARAFORMAT2 pf;
// Modify the paragraph format so that the text is centered.
pf.cbSize = sizeof(PARAFORMAT);
pf.dwMask = PFM_ALIGNMENT;
pf.wAlignment = PFA_JUSTIFY;
BOOL bOK = m_rtfControl.SetParaFormat(pf);
</pre>
Any help on getting over this hurdel would be much appreciated.
Tony
|
|
|
|