|
Hello amazing people, just have 2 questions
1- assuming I use Drawtext to output a text on HDC, is it possible to reverse that? i meant get that text which i drawn from HDC not from the buffer?
2- How in the world we know the length of executed code in an app? is it SizeOfRawData or what/?
I know how to use DOS header and the NTheader.. but i still do not know the length exactly, it seems that it's different if do calculation, I am sure that i did it wrong....
Thanks...
modified 6-Sep-13 4:00am.
|
|
|
|
|
1. I am not aware of any functions that can read a device context.
2. What do you mean by "length of executed code"? The size of an executable program in memory will be larger than its loadable exe file as it has the addition of stack and heap space. It can also grow and shrink during execution.
Veni, vidi, abiit domum
|
|
|
|
|
about the 2 question..
Yes i did mean that, but what if i want the size of written code inside a section? not the size of the section.. it's oky even if it before loading to the memory... basically not the extra 0000 in the size just the raw code....
this what i am trying to find out...?
modified 6-Sep-13 4:22am.
|
|
|
|
|
How do you define "written code inside a section", what is a section in this context? Do you mean source lines of code or object code, etc?
Veni, vidi, abiit domum
|
|
|
|
|
Hi to all.
In combobox control, I modified the context font,e.g. AMDGT_IV25,and display is ok.Now I need to get the item text, used the GetDlgItemText function,but the result was unrecognizable code.
Thanks!
|
|
|
|
|
just wondering A or W? the third parameter (LPSTR) or (LPWSTR) check that out...
modified 6-Sep-13 3:58am.
|
|
|
|
|
You do not use GetDlgItemText() to get a ComboBox item. Please show the code you are using, and what actual results you see.
Veni, vidi, abiit domum
|
|
|
|
|
Thanks for your answer
first:in CCombobox::DrawItem(LPDRAWITEMSTRUCT pDIStruct) function modified the dc font and dc.DrawText(str,itemRect,DT_LEFT|DT_VCENTER|DT_SINGLELINE);//显示文本
second: in mfc interface, display the special symbol.It's ok.e.g. input a "t",and display the special symbol.
third: how to get the special symbol string? E.g. is the "t" string,but other string.
Sorry!
|
|
|
|
|
Sorry but I did not understand that at all.
Veni, vidi, abiit domum
|
|
|
|
|
Hello there,
Is there a way i can convert a std::vector<byte> to MFC CString?
Also, Is there a way to convert std::string to MFC CString?
When i use,
std::string s;
CString str(s.c_str());
I see that it's not copying all the contents of std::string to CString.
Thanks in advance.
|
|
|
|
|
Don Guy wrote: Is there a way i can convert a std::vector<byte> to MFC CString? Yes, but you would need to write the code to make append vector item to the string in turn.
Don Guy wrote: I see that it's not copying all the contents of std::string to CString. You need to provide more information; show your code, and the values of all variables.
Veni, vidi, abiit domum
|
|
|
|
|
Hi,
I have a requirement.
1) Create a 4 GB data file in Hard disk by writing 2 MB at time. ( Don't worry, that I can manage )
2) It should be stored in continous locations( clusters ) in hard disk. Is their any method to ensure that?
Regards,
VCSharp
|
|
|
|
|
You would need to access the disk io API directory. Then via that
1. Find the contiguous clusters.
2. Mark them in use
3. Attach them to a file
4. Then write to the file, being careful to not exceed the maximum.
Naturally the application must also have permissions to access the API.
|
|
|
|
|
Hey there,
I am working on an MFC app that uses CDHtmlDialog class to create a dynamic HTML page.
Now i want to pass/stream a image pointer to the HTML page to show it to the users.
The image will be stored in the hard disk, and the MFC should have a way of streaming this to the HTML page for display on a particular user event.
I am not sure how to convert a JPG or GIF file into something else that i can pass to the HTML page.
Possibly as an argument to JavaScript function residing in the HTML page.
Any help is welcome. Please guide with sample codes.
Thanks in advance.
|
|
|
|
|
If it's a file on the HD simply use an image tag with a file URL[^].
Steve
|
|
|
|
|
|
Hi, dear all,
I have a program created using C++ MFC which works fine in USA, but when this program is used in Europe like Norway, the data is messed up. What I want to do is set the regional and location to US English always when program executes, how can I do it? Thanks you very much!
|
|
|
|
|
Is setlocale() or SetThreadLocale() of any help?
"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
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
what are enumerator and how it is different from struct & class
please explain all with some examples . i am beginner in c++
|
|
|
|
|
|
I need to generate variable sound ( system speaker is fine for now) , both in frequency (audio) and length (code). I do some processing in worker thread and I did tried Beep in worker thread , it is synchronous ( not really an issue) but it terminates the thread when completed. No good.
I tried MessageBeep and it did not do a thing, wrong audio anyway.
So is PlaySound (from a file) my only choice and if so how do I control the length of the "play"?
Any constructive suggestions are as always appreciated.
Cheers
Vaclav
|
|
|
|
|
Vaclav_Sal wrote: ...how do I control the length of the "play"? Have you experimented with the various SND_xxx flags?
"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
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Vaclav_Sal wrote: I did tried Beep in worker thread , it is synchronous ( not really an issue) but it terminates the thread when completed.
Beep does not terminate a thread, but your code may do so. You could easily write a method that repeatedly calls Beep and run it in a thread that does not terminate.
Veni, vidi, abiit domum
|
|
|
|
|
Richard,
I'll get back to you on this one. The section of code in question is "broken".
I hope you are right and I had something else doing the deed.
But I checked elsewhere and really did not pull the silly idea of Beep terminating the thread out of my hat. Of course now I cannot find the source!
Right now I think the Beep is run in its own thread and what I saw in debug was message terminating that thread.
Thanks for your help.
Vaclav
|
|
|
|
|
The problem is you never give us all the information necessary to try and offer suggestions. You stated earlier that Beep() terminates a thread, but now you cannot find the source. So we have no way of even guessing what your code may be doing.
Veni, vidi, abiit domum
|
|
|
|