|
What you are experiencing is windows' method of representing shortcuts. So what you have to do in order to get the text "p&m" is to use the folowing ampersand escape sequence:
DrawText(_T("p&&m"), LPRECT(CRect(0,0,100,100)), DT_LEFT);
For more details look up escape characters on msdn
|
|
|
|
|
DrawText(_T("Thank you Mike && mikanu for your help"), LPRECT(CRect(0,0,100,100)), DT_LEFT | DT_NOPREFIX)
|
|
|
|
|
In Visual Studio 6, is it possible to enable breakpoints only for a certain thread? It is little annoying when the debugging context suddenly changes to another thread.
If it is not possible in Visual Studio 6, is it possible atleast in WinDbg?
thanks!
|
|
|
|
|
You can put conditions on breakpoints. If you have a variable that represents the active thread, you could use that.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
I attempted to use WMF SDK, but ran into link error.
DRMShow.cpp
Generating Code...
Linking...
WMStubDRM_38503.lib(so3.obj) : error LNK2001: unresolved external symbol __ftol2
WMStubDRM_38503.lib(rc4safe.obj) : error LNK2001: unresolved external symbol __SEH_epilog
WMStubDRM_38503.lib(cpu.obj) : error LNK2001: unresolved external symbol __SEH_epilog
WMStubDRM_38503.lib(rc4safe.obj) : error LNK2001: unresolved external symbol __SEH_prolog
WMStubDRM_38503.lib(cpu.obj) : error LNK2001: unresolved external symbol __SEH_prolog
Debug/DRMShow.exe : fatal error LNK1120: 3 unresolved externals
Error executing link.exe.
Yong
|
|
|
|
|
yongwpi wrote: WMStubDRM_38503.lib(rc4safe.obj) : error LNK2001: unresolved external symbol __SEH_epilog
WMStubDRM_38503.lib(cpu.obj) : error LNK2001: unresolved external symbol __SEH_epilog
WMStubDRM_38503.lib(rc4safe.obj) : error LNK2001: unresolved external symbol __SEH_prolog
WMStubDRM_38503.lib(cpu.obj) : error LNK2001: unresolved external symbol __SEH_prolog
Doesn't this require linking with sehprolg.obj ?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Are you using VC6? If so, you're SOL. MS stopped releasing VC6-compatible LIBs a couple years ago.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | 1ClickPicGrabber | NEW~! CP SearchBar v3.0 | C++ Forum FAQ
"Linux is good. It can do no wrong. It is open source so must be right. It has penguins. I want to eat your brain."
-- Paul Watson, Linux Zombie
|
|
|
|
|
many functions require parameters of type HANDLE. how to get it? take the following for instance:
CEdit *pEdit;
pEdit = new CEdit();
pEdit->Create(0,rect,this,IDC_EDIT1);
...
delete pEdit;
Thank you very much!!!
-------------------
I am learning C++ and English
|
|
|
|
|
ewighell wrote: // how can I get a handle to the Edit window?
Use the GetSafeHwnd() method. However, why do you need it?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
I want to send a message with the function SendMessage(), it seems that some of its parameters are of type HWND.
I want to send a BN_CLICKED message to the button m_bn1, which is of type CButton with the following code, but it seems does not work, where am I wrong?
SendMessage(BN_CLICKED,IDC_BUTTON1,(LPARAM)m_bn1.GetSafeHwnd());
Thank you very much!!!
-------------------
I am learning C++ and English
-- modified at 21:47 Tuesday 15th November, 2005
|
|
|
|
|
First, you don't need to get the HWND. You can just call pEdit->SendMessage(msg, wparam, lparam).
But, it won't work in your case. BN_CLICKED is a notification send by the button to its parent, not the other way aroiund . And it's not a BN_CLICKED message, it's a WM_COMMAND message with BN_CLICKED encoded in its WPARAM parameter (see MSDN for details).
What do you want to accomplish?
Cheers
Steen.
"To claim that computer games influence children is ridiculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
|
I am trying to debug a program using Visual Studio, but one of my local values in not matching what is printed using printf. Any ideas?
simaneal
|
|
|
|
|
Have you checked the format?
int %d
float %f
double %lf
....
Matteo
|
|
|
|
|
What do you mean ? You watch your variable with the debugger and it doesn't match what you printed with printf ?
Are you sure you are using the right format specification for your variable ?
Also, post the code (use the code tag just above the emoticons), this will be easier for us.
|
|
|
|
|
<br />
#include <stdlib.h><br />
#include <stdio.h><br />
#include <math.h><br />
#include <time.h><br />
#include <stddef.h><br />
#include <malloc.h><br />
<br />
#define nmax 118/* Maximum Number of pixels + 1 */<br />
#define npixels 117 /* Number of pixels in forest */<br />
#define tfactor 0.95 /* annealing temperature factor */<br />
#define xcoor 10/* maximum x coordinate */<br />
#define ycoor 117 /* maximum y coordinate */<br />
#define period 20 /* investment and management time period of interest */<br />
#define i 0.04 /* interest rate for discount factor */<br />
#define tmax 2 /*maximim number of feasible moves before stopping*/<br />
#define array_size 117<br />
<br />
<br />
<br />
int<br />
main (void)<br />
{<br />
<br />
int y;<br />
printf("starting\n");<br />
int *pix1;<br />
<br />
if ((pix1 = (int*)malloc(array_size * sizeof(pix1))) == NULL) {<br />
(void)printf("ERROR: Malloc failed");<br />
(void)exit(EXIT_FAILURE); <br />
}<br />
<br />
int *pixm1;<br />
<br />
if ((pixm1 = (int*)malloc(array_size * sizeof(pixm1))) == NULL) {<br />
(void)fprintf(stderr, "ERROR: Malloc failed");<br />
(void)exit(EXIT_FAILURE); <br />
} <br />
for(y=0; y<ycoor; ++y)<br />
{<br />
<br />
pix1[y]=1;<br />
pixm1[y]=1;<br />
printf("pix1= %d",pix1[y]);<br />
}<br />
int ymoves;<br />
for(ymoves=0; ymoves<ycoor; ymoves++)<br />
{<br />
if(pix1[ymoves==1)<br />
{pixm1[ymoves]=0;<br />
printf("pixm1= %d", pixm1[ymoves]);<br />
}<br />
else<br />
{<br />
pixm1[ymoves]=1;<br />
}}<br />
}<br />
return;<br />
<br />
The code is a mini version of the code I am having problems with. When I watch the locals pixm1[] is supposed to switch from a 1 to 0 and it does not. The printf statement output is pixm1 =0
I do not understand why they would be different and which one reflects what the program has as pixm1[]?
simaneal
|
|
|
|
|
Your code is not clear, but have you checked well this line?
if(pix1[ymoves==1)
Are you meaning
if(pixm1[ymoves]==1)
???
Try to write the code with a better format.
Matteo
|
|
|
|
|
I meant if(pix1[ymoves]==1)
I am trying to get pixm1[] to change based on what pix1[] is. The full code is on another computer and is to long to display here.
simaneal
|
|
|
|
|
I understand you.
But take in mind that at 99% is a your sintax error, so it is important to look at the real code.
I have to go home,
good luck.;)
|
|
|
|
|
simaneal wrote: if ((pix1 = (int*)malloc(array_size * sizeof(pix1))) == NULL) {
This code is incorrect if you are simply wanting room for 117 int s. Use one of the following instead:
int pix1[117];
...
int *pix1 = (int *) malloc(array_size * sizeof(int));
if (pix1 == NULL)
simaneal wrote: When I watch the locals pixm1[] is supposed to switch from a 1 to 0 and it does not.
How are you verifying this?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Hi,
I use Microsoft visual studio .net 2003.
When I'm in debug mode I can press F10 to execute single instructions (that are usually 5/10 disassembly instructions).
I have a problem with my software, and I need to execute disassembly instructions one by one.
Someone knows a way to change the editor setup and press F10(or something quite faster) to do this?
Thanks to all
|
|
|
|
|
If you debug from the assembly view it will execute the instructions one at a time.
|
|
|
|
|
Sorry but the real problem is different:
Someone used my pc last week and now everytime that I press F10 the debugger execute a single disassembly instruction!
That person remembers that he changed a flag into the opsions-setup, but he don't remember what!!!!
can you help me??
|
|
|
|
|
i have made an apllication that creates a 5MB shared memory.But analysing the memory usage displayed in the taskmanager,i found out that,this memory is not added to the process' memory.Can anyone tell where is the shared memory created and to whom's account it goes?
nav
|
|
|
|
|
Make sure you look at 'VM Size' and not 'Mem Usage' column.
The increased use of the Virtual Memory will be reflected in the 'VM Size' column.
Each process 'mapping' the shared memory will reflect the 5 MB in its 'VM Size' column in task manager. No particular proces 'owns' the memory, they all do. Each process has it mapped into its own virtual address space. The base address need not necessarily be the same in each process, but it can be forced that way.
|
|
|
|