|
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
|
|
|
|
|
Hi,I read some articles, some say enum constant not ocuupy storage in memory, some say it does.
I wonder, for example, enum Weekday {sun,mon,tue,wen,thu,fri,sat}, then where is the Weekday be stored at?
And I want to declare a enum consant like:
enum XXYY {xx1=100,xx2=3000,yy1=4500,yy2=32}, is that ok? or
have to define: enum XXYY { xx1=32,xx2=100,yy1=3000,yy2=4500}?
|
|
|
|
|
The enum members can have any int value. All of them can have the same value, they can have random order.
The only two "rules" that you have to know: If you don't define the value of the first enum member then its automatically 0. If you don't define the value of any of the other non-first enum members then their value is automatically the value of the previous member + 1. Using enums to declare constants in header files (even inside classes) is a good old trick. If you use the enum just to define constants then you dont have to give a name for the enum itself:
enum {
val0 = 5,
val1 = 1,
val3 = 4,
};
EDIT: The weekday enum itself is just a type. A type doesn't occupy any memory. If you declare/define a variable of that enum type then the variable occupies some memory, the same amount as an int variable:
Weekday wd;
void func()
{
Weekday w;
enum Weekday ww;
}
class C
{
private:
Weekday m_Weekday;
};
|
|
|
|