|
most often an icon file holds the same image at different sizes, and Windows chooses the one that fits its needs. Maybe your icon isn't available at the size Windows would like? I suggest you compare your current situation with other projects you did successfully.
Luc Pattyn [My Articles] Nil Volentibus Arduum
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Please use <PRE> tags for code snippets, they improve readability. CP Vanity has been updated to V2.4
|
|
|
|
|
I can't be sure (can't test it at the moment), but shouldn't you pass the current instance to LoadIcon, since you're not loading a standard Icon but one in your executable file?
|
|
|
|
|
Hi. Lets say, we got such 2 scenarios where we are receiving data over a socket:
1. Using WSARecv
CHAR Buffer[1024];
WSABUF wsaBuffer;
DWORD dwBytesRecved = 0;
wsaBuffer.buf = (char *)Buffer;
wsaBuffer.len = sizeof(Buffer);
OVERLAPPED overLap;
::RtlSecureZeroMemory(&overLap, sizeof(overLap));
DWORD dwFlags = 0;
::WSARecv(sock, &wsaBuffer, 1, &dwBytesRecved, &dwFlags, &overLap, NULL);
wsaBuffer.buf[dwBytesRecved] = '\0';
cout << wsaBuffer.buf << ", Bytes: " << dwBytesRecved << endl;
2. And this one, using recv
CHAR Buffer[1024];
int recved = ::recv(sock, Buffer, size, 0);
Buffer[recved] = '\0';
cout << Buffer << ", Bytes: " << recved << endl;
In both cases, we are receiving only one buffer. (WSABUF allows to specify more then 1 recv buffer).
And now, in case of recv, i can do something like this:
1. i got my recv buffer size, lets say 1024 bytes and doing recv.
2. Ok, i got some data and its length is 512 bytes and it has been copied to my recv buffer. But i know, that i should receive 1024 bytes of data.
3. So i am going to recv data in a loop until all 1024 bytes arrived.
4. Ok, i got some data again and it seems like it is next 512 bytes, but this time i am calling recv like this:
int recved = ::recv(sock, Buffer + already_received_number_of_bytes, size, 0);
So the rest of received data is appended to my recv buffer and in the end my recv buffer contains all data.
The question is: how can i do this with WSARecv ?
Thanks.
011011010110000101100011011010000110100101101110
0110010101110011
|
|
|
|
|
Is it possible to make an application to show a modeless dialog and wait there(without executing the next statement) until the modeless dialog is closed
|
|
|
|
|
Yes, but why bother when a modal dialog does that for you.
The best things in life are not things.
|
|
|
|
|
I am having a dialog with button controls
I am invoking the same dialog from 2 places (At the first place the call is using domodal(), the second place the call is using create and showwindow)
I want to disable a few button controls when I call the dialog using domodal() but the same buttons should be enabled during the next modeless call.
kindly suggest me how to enable/disable a button when opening the dialog using domodal()
|
|
|
|
|
Handle the WM_INITDIALOG [^] message, and enable or disable each control as appropriate.
The best things in life are not things.
|
|
|
|
|
You can use CWnd::EnableWindow() to enable/disable buttons... you should however, do this from within the class (i.e. an external class should probably not be controlling buttons on a different class directly). So you can maybe set a control variable in when you create the dialog class so that you can handle the enabling/disabling OnInitDialog() (the proper place to initialize GUI components).
|
|
|
|
|
I want to develop an application with MFC,which has similar functions to Gantt chart.But I don't know how to start,please give me some advice.Many thanks in advance.
|
|
|
|
|
It's impossible to give an answer to such questions in a technical forum. You need to analyse your requirements and figure out how you wish to represent the data in your charts. The chances are that you will be drawing lines and blocks so the GDI+[^] classes will probably be of some use.
The best things in life are not things.
|
|
|
|
|
Thank you.It's really very difficulty.Let me have a try.
|
|
|
|
|
|
Thank you.I'll read it carefully!
|
|
|
|
|
Jokcy wrote: I want to develop an application with MFC,which has similar functions to Gantt
chart.
I am assuming you have 3-4 yrs of development experience in MFC. if you want to develop your own charting control, you can go through GDi and GDI+ classes, which provide you low level access to window graphics.
Otherwise google is always your good friends for developer!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
I am a green hand .Anyway,thank you all the same.I just want to train myself.
|
|
|
|
|
I draw a bitmap in the window client area
case WM_PAINT:
hdc = BeginPaint(hWnd, &ps);
memDC = CreateCompatibleDC(hdc);
SelectObject(memDC,hbmp);
GetObject(bmp, sizeof(bm), &bm);
GetClientRect(hWnd,&rcc);
BitBlt(hdc,
0,0, rcc.right,rcc.bottom,
memDC,
0,0,SRCCOPY);
If the the bitmap is bigger than the client area how can i implement VSCROLL and HSCROLL?
|
|
|
|
|
|
In my program I have a MainThread and more WorkerThread. Suppose that at certain event (which I'll manage) the MainTh must send a string (char []) to all WorkerTh, which will then process the request and send a response to MainTh.
What methods provided by windows are more suitable to handle a similar thing?
|
|
|
|
|
I usually use messages... SendMessage() and PostMessage() methods, with the latter being most appropriate for unsynchronized communications between threads...
|
|
|
|
|
create event to notify mani thread that someting done .
|
|
|
|
|
Hi all,
I'm using multiple document types (e.g. *.txt, *.xml) in a SDI type application, with two CSingleDocTemplate objects that handles two different file formats. The view class is the same for both document templates. However, when opening a file of the type that isn't currently open, MFC creates a new top level frame instead of disposing of the old view. This happens in CSingleDocTemplate::OpenDocumentFile , but I'm not that happy about overriding stuff about the view/doc logic of MFC.
What I want is to keep the same frame for both document types, but from what I can read in the MFC source, the framework isn't really designed for that behaviour.
Anyone with some experience of this?
|
|
|
|
|
i have an MFC c++ application build with /clr option and have integrated crash reporting feature.
the crash dump it generates does not show line numbers when i debug the dump using windbg.
(i found that applications build with clr does not show line numbers)
it shows the function name where it crashed but not the exact line number. for eg
it shows:
03434456 02312434 CExApp::OnOpenFile() + 0x30c
whats 0x30c ? is it an offset in the function?
Is there any way to calculate the line number by using 0x30c ?
thanks
|
|
|
|
|
|
Hello,
consider the following program
void main()
{
int tr = 0;
int rows = 256;
int ms = 3;
tr += (rows & (1 << (ms - 1))) << (ms - 1);
tr = rows & (~(1 << ms));
}
in above program have used only 3 integers...so can we consider that this program's memory requirement will be 3 integers (3*4 bytes).
or the compiler will generate some intermediate integers for storing values of expressions like
(~(1 << ms)) etc... and thus the memory requirements of this program will be more than 3 integers.
i know it all depends upon how the compiler generates the code.
but wanted to know the relation (w.r.t memory) between the variables declared and the intermediate expressions.
Or you may please direct me to appropriate resources (forums, links)for this..
Thanks.
|
|
|
|
|
If you are using Visual Studio then you have the opportunity to see the disassembly listing (for instance via the debugger or the /FA compiler option). Other compilers may provide you this facility as well.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|