|
Don't use casts - especially C-style casts - unless you know exactly what you're doing. If you must cast without fully understanding the ramifications using static_cast instead is safer; but still not safe in all situations.
If you want to encode binary data in XML you'll have to encode it. For example you could base64 encode it.
Steve
|
|
|
|
|
Hie,
For logging purpose I am using a text file. I am going to perform following actions
1) Check if file already present
2) if not create a new file
3) if file exists , open it in appead mode.
4) Add data.
5) close the file
My concern if the file size is too big say 500MB. Will there be any performance hit on accessing file in appead mode from disk?
Vikram S
|
|
|
|
|
I have a parent and child window.Child window is having a figure in it.When i resize/restore the child window the figure also has to be scaled accordingly.How to do it?Plz help..........
|
|
|
|
|
Handle the WM_SIZE message and resize the figure there.
|
|
|
|
|
|
Hi all,
Could someone please help me with (information | use on) wildcards in VC++.
Thank you very much in advance.
Regards
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
what do you want to do with wildcards?
|
|
|
|
|
I want to get all the files with a certain extension (example: *.bir) and then my TCP/IP server must send those files to the remot client. Whats why I want to know how to use wildcards...
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Programm3r wrote: I want to get all the files with a certain extension (example: *.bir)
the FindFirstFile/FindNextFile API will do both of those things for you.
|
|
|
|
|
Thank you very much Chris ... I was not aware of that...
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Hi,
I'm having a DLL that exports a class. Each instance of this class should be able to create its own window. Therefore I created a WindowProc class member to process messages to the created window.
While trying to register a window class for my class I tried to configure the message processing by filling the lpfnWndProc field of WNDCLASSEX structure with a pointer to WindowProc. I couldn't get this to compile if the WindowProc function is not *static*. This is not acceptable because this means all instances of my class share the same WindowProc so I don't know which instance should process the messages.
What is the appropriate design to do what I want ?
Thanks
|
|
|
|
|
This is because the functions don't have the same prototype: for the member function, there is a implicit parameter passed, the this parameter (allowing the function to know to which instance it belongs to).
To overcome this problem, when you create your window (use CreateWindow), you can pass a pointer to user data. Pass the this parameter, so that the first time your static window procedure gets called, it will receive the instance of the class. Then, register this pointer with SetWindowLong (it will associate the instance pointer with the handle of the window):
if (Msg == WM_CREATE)<br />
SetWindowLong(hWnd, GWL_USERDATA,(long) ( (LPCREATESTRUCT(lParam))->lpCreateParams));
Then, after each call of your static procedure, you are able to retrieve the class instance and call a public non-static window procedure:
CMyClass* pClass = (CMyClass*)GetWindowLong(hWnd,GWL_USERDATA);
hWnd is the handle of the window passed as parameter to the procedure. Check the different functions in the doc for more details.
Hope this helps
|
|
|
|
|
Thanks,
This solves my problem. I might be using a "std::map<hwnd, cmyclass*="">" instead to find the class instance knowing the hwnd but the idea is the same. I mostly wanted to check that it's not a bad design have the same WindowProc for all my instances and therefore have to lookup the class instance everytime.
|
|
|
|
|
Tnarol wrote: I might be using a "std::map" instead
You'll have to make it static so that all instances share the same map than.
|
|
|
|
|
|
Hello !
I'm a student in a french engineering school (ECE) and we (me and some mates) are working on a project (a voice recognition lock).
We are actually looking for a source showing the use of Fast Fourier Transform.
We saw some very nice article about FFT in this site, but we need a real starting point, a simple program in C (something easy to compil, if possible )
With : an FFT algorithm
and : the frequency of the sound
As the project progress, we'd be happy to share with you our sources, and we'd be pleased to recieve answers and/or e-mails with anything that could help us.
Best regards,
|
|
|
|
|
Hi,
I'm creating a property sheet inside another property sheet. I have a main view, where I'm putting the main property sheet which has 6 tabs( property pages). In the first tab I'm having 2 tabs, which is having so many controls. I'm drawing the property pages and controls using SetwindowPos(). The problem is when I first open the tab, the controls are not drawn, when I switch to the next tab and come back, the controls will appear.what could be the problem. where should I draw the controls ? Now I'm calling the fnDraw() in onInitDialog() & onSetActive() function. What is wrong...any idea how to do it. Hope my question is clear.
Thanks
|
|
|
|
|
Hi,
Have you tried using Tab control inside of propertysheet?
I'm not quite sure if CProtertySheet is designed to be nested inside another one.
Regards
|
|
|
|
|
No..I have not tried Tab control.
|
|
|
|
|
hi Everybody
i planned to do soft in Borland C++
and i need to take information from Sound Card
and i've problem in finding appropriate object(component) which enables me to take info from Sound Card
please help
thanks..
|
|
|
|
|
Hi Friends,
with reference to http://www.codeproject.com/tips/CSMTPConnection2.asp link
i have a query..
I am going to implement the same but whenever i sets subject it gives exception,please help me to get rid of this problem.
Thanks in advance.
The secret of life is not enjoyment
but education through experience.
- Swami Vivekananda.
|
|
|
|
|
Did you read comments? http://www.codeproject.com/tips/CSMTPConnection2.asp?df=100&forumid=171182&select=1145121#xx1145121xx
Regards
|
|
|
|
|
Thank you very much for ur valuable HELP.
It is working fine now.
The secret of life is not enjoyment
but education through experience.
- Swami Vivekananda.
|
|
|
|
|
could please some one explain me what is this "nPage" exactly for?
thankx
Must..kill..all..humans!
|
|
|
|
|
As stated in MSDN:
nPage
Specifies the page size. A scroll bar uses this value to determine the
appropriate size of the proportional scroll box.
I think that the following excerpt of MSDN sample Example of Scrolling Text makes it clearer:
case WM_SIZE:
yClient = HIWORD (lParam);
xClient = LOWORD (lParam);
yMax = max (0, LINES + 2 - yClient/yChar);
yPos = min (yPos, yMax);
si.cbSize = sizeof(si);
si.fMask = SIF_RANGE | SIF_PAGE | SIF_POS;
si.nMin = 0;
si.nMax = yMax;
si.nPage = yClient / yChar;
si.nPos = yPos;
SetScrollInfo(hwnd, SB_VERT, &si, TRUE);
As you can see, after setting up the scroll range, you should give a clue of the VISIBLE range (your client area) so that the scroll box will have reasonable dimensions.
Hope that helps.
|
|
|
|