|
That depends on the function you are using it in.
For example, the CreateCompatibleDC function says that if HDC is NULL it uses the current screen as the reference.
So if there is nothing mentioned about the behavior when HDC is NULL , if sure the behavior is undefined and you should not do that.
|
|
|
|
|
I am using HDC to write to a PDF printer. But the code is so entagled that, there's pieces of a text file writing code is also between that.
So when there's a case that only a text file need to be written and no PDF, then i pass the HDC for PDF as NULL.
So far in my testing i have seen that this works perfect.
Is there any other function that will return me a valid HDC, but will not mess up any text file writing?
Can i use CreateCompatibleDC to pass an HDC that will not mess up any other part of the application? But at the same time there will be a valid HDC rather than a NULL one.
Thanks
|
|
|
|
|
I think I have too little understanding to give a reliable answer.
You will need to break up your question and isolate it from your domain if I need to understand.
|
|
|
|
|
Hi ,
While running an exe from service window , its throwing like
"The exception Unknown software exception (0x40000015) occurred in the application at location 0x781346b4."
Error 1067: the process terminated unexceptedly.
And in the Event viewer ...it is showing the message as ..
Faulting application mtserver.exe, version 6.2.86.0, faulting module msvcr80.dll, version 8.0.50727.4053, fault address 0x000046b4.
Note: its working fine in debug mode.
Please let me know ur valuable comments.
Ur help much appreciated
Regds
Jain
|
|
|
|
|
Does it fail even if the EXE is executed by double clicking from user mode?
If so try attaching a debugger to the process.
You could try running the EXE in debug mode, but without attaching the debugger (Ctrl + F5).
|
|
|
|
|
Hi everybody,
I like to find out where a function or maybe an entire library allocates a huge amount of memory.
In the task-manager I see that the application really uses 25MB of the memory and allocates a total of 166MB.
I tested already GlowCode, but it displays only the memory which is really in use.
Is there another tool or programming technique to find the call of the function?
Big thanks for any help
|
|
|
|
|
baerten wrote: Is there another tool or programming technique to find the call of the function?
"One man's wage rise is another man's price increase." - Harold Wilson
"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
|
|
|
|
|
I think he meant which code calls the heap allocator?
Try IBM Rational Purify. They have 30-day license I believe. It should keep track of allocations and deallocations, leaks, etc, complete with the stack of the callers.
|
|
|
|
|
i'm so foolish, who can help me?
i got one message identification, for example, it's 0x10b3, how can i get the described information about it?
as above is just one instance, if many message identification arise, i'll jump into whirlpool
|
|
|
|
|
|
sunen wrote: ...how can i get the described information about it?
Given that you've simply shown a base-16 number, how are we to know?
"One man's wage rise is another man's price increase." - Harold Wilson
"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
|
|
|
|
|
A fool is someone who fails to learn.
So, asking this question once is not foolish. Asking the same question again, will be.
So, to your actual question. Read the following blog article. I'll wait.
The Old New Thing: Which message numbers belong to whom?[^]
.
.
.
.
Back already? Wow!
So, 0x10b3 lies solidly in the class defined message category. So, without knowing what kind of window you have (or more importantly: what kind of window other code thinks you have), it's impossible at answer your question.
Without knowing a lot more, we can't help, sorry.
I wish you luck, and cleverness,
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
you're a good man, thank you very much
|
|
|
|
|
Hi,
I tried to use "GlobalLock" to get HBITMAP data. But it returns NULL.
void myfunc(HBITMAP hMen)
{
....
lpVoid = (UCHAR *)GlobalLock(hMem);
....
}
lpVoid is NULL
What else function I can use to get Bitmap data from HBITMAP?
Thanks,
|
|
|
|
|
transoft wrote: Why GlobalLock failed?
I found this little detail in the documentation[^] page:
If the function fails, the return value is NULL. To get extended error information, call GetLastError()[^].
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
transoft wrote: What else function I can use to get Bitmap data from HBITMAP?
GetDIBits
an HBITMAP is not an HGLOBAL.
|
|
|
|
|
Hello,
when i came with the debugger to a function like this my
debugger will step into an little part of assembler.
i think it is the constructor.
how can i deactivate this sh*t!
i use MFC 2003 Version 7.1
void test(CString compress)
{
}
test("HALLO");
Thanks
|
|
|
|
|
Hwewet wrote: how can i deactivate this sh*t!
This type of language should be reserved for the back room.
However if you do not want to see the assembler then use "Step Over" rather than "Step Into".
|
|
|
|
|
I'm not sure that I understand your query right, but you're probably pressing F11 instead of F10?
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
What i mean is when the CString is part of an function call.
When i try to step into the function first all of the Cstring constructors
comes with assembler code.
void function(CString xy,CString xy,CString xy)
{
}
F11
first CString assembler, sec. CString assembler,..., enter function...
|
|
|
|
|
you could press ctrl + tab and it'll restore the nature view
|
|
|
|
|
Hi,
This is not the proper forum for my question.But i dont know where to post it.sorry.
Iam planning to use WPF controls in my MFC application.Either directly or by creating DLL in C#.
But i dont know anything about that.Is there any book to buy about WPF and VC++.
Pls provide me any information on that.
Just i want is..the look of WPF like buttons,colored Listbox,colored Dialog.But functionality of all buttons should come in MFC applcaition only.
Anu
|
|
|
|
|
|
Hi,
After some struggle, and some good help from this forum, I find that I am now more or less managing to be able to manage my owner draw list box, except for 1 issue.
The strings I want to use contain tabs.
When I set my CreateStruct up in my PreCreateWindow, I have to disable LBS_MULTICOLUMN or my custom DrawItem function does not get called.
The downside of disabling the LBS_MULTICOLUMN is that the tabs in the string are discarded and my formatting goes to pot, even when configuring LBS_USETABSTOPS.
Any Suggestions?
TIA
Tony
|
|
|
|
|
maycockt wrote: ...even when configuring LBS_USETABSTOPS.
Did you send the control a LB_SETTABSTOPS message?
"One man's wage rise is another man's price increase." - Harold Wilson
"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
|
|
|
|