|
|
when i run my program via VC++ (by pressing F5) a specified function (OnSize) is called while when i run it outside of VC++ it isn't!!!
i checked it by writing something in a file.
please give a technical answer, i've examined all ordinary cases.
|
|
|
|
|
I can give you 3 possible solutions.
1) Do a complete rebuild.
2) Is your file closed? if that doesn't work try to flush it first.
3) Set a Beep command
If these don't work, I don't know it either. (but sometimes I have the same problem and these always worked)
Good Luck
|
|
|
|
|
Hai,
I am quet new to Visual Studio. I want to write my database programs using the Dialogue Box forms instead of Single/multiple Documents forms.
It is queit is easy to do it using documents. But I dont like the forms. I prefere using Dialogue Boxes to write Database programs.
How I can I access the Database when using dialogue Boxes.
Lloyd.
|
|
|
|
|
Wisdom2004 wrote:
How I can I access the Database when using dialogue Boxes.
How you present the data has no bearing on how you access the data. In either case, derive a class from CRecordset .
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I have downloaded the source code of windows 2000.
How can I compile them? Whitch tool may I use?
thanks.
Hi guys. I'm a very man. Do you like fat men?
|
|
|
|
|
Where did you get that?
Maxwell Chen
|
|
|
|
|
Don't care, don't want to know. I never want to see a single line of OS code that isn't legitimately in the public domain, purely to avoid a situation later where MS hit anyone who has 'remembered' so much as that single line.
If you admit to having read it, how do you prove you aren't using (copyrighted) code from it, for example?
The fat man is either raving, or stupid to even post that question, in my opinion.
Steve S
|
|
|
|
|
I can not believe that you told the truth.
|
|
|
|
|
ahahah; nice try.
vote : 1. that's all you need !
TOXCCT >>> GEII power
|
|
|
|
|
I doubt that it is the entire code. IIRC some service pack code was stolen at one time.
Anyway bad choice of question for an open forum!
Ant.
|
|
|
|
|
I wrote a simple win32 application using VC6.0. In the below are my codes. Can you tell me why this program always quit with an error? Thank you for your help!
LRESULT CALLBACK mainWndProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
PAINTSTRUCT ps;
switch (uMsg)
{
case WM_CREATE:
return 0;
case WM_PAINT:
hdc=BeginPaint(hwnd, &ps);
TextOut(hdc, 0, 0, "I love you.", 15);
EndPaint(hwnd, &ps);
return 0;
case WM_SIZE:
return 0;
case WM_CLOSE:
DestroyWindow(hwnd);
return 0;
case WM_DESTROY:
return DefWindowProc(hwnd, uMsg, wParam,lParam);
default:
return DefWindowProc(hwnd, uMsg, wParam,lParam);
}
return 0;
}
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
// TODO: Place code here.
HWND hwndMain;
WNDCLASS wndClass;
MSG message;
hinstance=hInstance;
int nRet;
if(hinstance)
{
wndClass.style=0;
wndClass.lpszClassName="MainWindow";
wndClass.lpszMenuName="MainMenu";
wndClass.lpfnWndProc=mainWndProc;
wndClass.hInstance=hinstance;
wndClass.hCursor=LoadCursor(NULL, IDC_ARROW);
wndClass.hIcon=LoadIconhinstance,
"icon1.ico");
wndClass.hbrBackground= (HBRUSH)GetStockObject(WHITE_BRUSH);
wndClass.cbClsExtra=0;
wndClass.cbWndExtra=0;
}
RegisterClass(&wndClass);
hwndMain=CreateWindow( "MainWindow", "Test main",
WS_OVERLAPPEDWINDOW | WS_HSCROLL |
WS_VSCROLL, // vertical scroll bar
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
(HWND)NULL,
(HMENU)NULL,
hInstance,
NULL);
if(!hwndMain) return false;
ShowWindow(hwndMain, SW_SHOWDEFAULT);
UpdateWindow(hwndMain);
do
{
nRet=GetMessage( &message, hwndMain, 0, 0 );
if(!nRet)
{
break;
}
if(nRet==-1)
{
//log the error
return 0;
}
else
{
TranslateMessage(&message);
DispatchMessage(&message);
}
}
while(1);
return message.wParam;
}
|
|
|
|
|
Just fix:
<br />
LRESULT CALLBACK mainWndProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)<br />
{<br />
HDC hdc;<br />
PAINTSTRUCT ps;<br />
switch (uMsg) <br />
{ <br />
case WM_CREATE: <br />
return 0; <br />
case WM_PAINT: <br />
hdc=BeginPaint(hwnd, &ps);<br />
TextOut(hdc, 0, 0, "I love you.", 15);<br />
EndPaint(hwnd, &ps);<br />
return 0; <br />
case WM_SIZE: <br />
return 0; <br />
case WM_DESTROY:
PostQuitMessage(0);<br />
return 0 ;<br />
}<br />
return DefWindowProc (hwnd, message, wParam, lParam) ;<br />
}<br />
|
|
|
|
|
Hi,
I am a newbee to programming using c/c++. I want to find out total memory occupied by a linked list in the memory. What is the easiest way to find it out.
|
|
|
|
|
I am not sure, but... how do you think:
std::list<T> foo;<br />
foo.size() * sizeof(T) + sizeof(foo);
Maxwell Chen
|
|
|
|
|
what sort of list ? list<> ?
or a simple array ?
for an array, you should have a trailing NULL at the end, to get the size (unless you already know the size you allocated).
for a list<> you get the nember of elements in the list that you multiply this by the size of an element, plus the size of the list object itself.
TOXCCT >>> GEII power
|
|
|
|
|
(1)list constructed ,what is its elements type? ie:list<int> ,list<string>,list<char> ..
(@) if list<int>,by sizeof(int) ,i can know the byte occupied by the type in your computer,then setting a varible , by iterator i can know the elements numbers in list.by this ,i can know the list occupied the byte number in member
but if list<string>,the case will be a little trouble,you need check out the words numbers in every string,the left solving way are similar the above
|
|
|
|
|
I want to develop a tool which is similar with test automation tool. This tool launches a cmd window and writes some command lines in that window. Now I am able to get cmd window handle, but I don't know how to write the lines. Could anyone help me and I will appreciate it. Here is the code I have done.
WinExec("cmd.exe", SW_SHOW);
CWnd* pDeskWnd = CWnd::GetDesktopWindow();
CWnd* pPrevWnd = pDeskWnd->GetWindow(GW_CHILD);
while (pPrevWnd)
{
CString s;
pPrevWnd->GetWindowText(s);
if (s.CompareNoCase("C:\\WINDOWS\\System32\\cmd.exe") == 0)
{
if (pPrevWnd->IsIconic())
pPrevWnd->ShowWindow(SW_RESTORE);
pPrevWnd->SetForegroundWindow();
pPrevWnd->GetLastActivePopup()->SetForegroundWindow();
CWnd* pCmd = pPrevWnd->GetActiveWindow();
// CPoint id = pPrevWnd->GetActiveWindow();// GetDlgCtrlID();
// pPrevWnd->SetDlgItemText(id, "A command");
/* CDC* pDC = pPrevWnd->GetDC();
pDC->TextOut(0, 100, "A command I want to issue ");*/
return;
}
pPrevWnd = pPrevWnd->GetWindow(GW_HWNDNEXT);
}
|
|
|
|
|
|
But the cmd.exe window is not listening.
|
|
|
|
|
|
I have modified MFCs CFileDialog so that there is a bitmap behind all controls. Now I need to disable AutoComplete functionality from edit control. can anyone help me with this?
|
|
|
|
|
I'm just starting to do some socket programming (non-MFC) and had a couple questions. Is there a ReadLine function to read a single line from a socket? If not would a line be terminated by a \r \n or both? Lastly is there a function to "peek" at the data waiting to be read? Like the peekmessage that would allow me to retreive the the waiting data without actually removing it from the socket?
Thanks.
- Aaron
|
|
|
|
|
use the recv function to read from the socket.
the recv function can be blocking or non-blocking
according to the connection specified...
these sockets are known as synchronous sockets
but, if u wish to get a notification whenever a message reaches the port , then use asynchronous sockets.
there are various options: FD_READ|FD_WRITE|FD_CLOSE|FD_CONNECT
, etc etc...
u have to use the API: WSAAsyncSelect....
search for the API in MSDN and include the required library and header file..
i think the library is : Ws2_32.lib
and header file is winsock2.h , i think winsock.h will also work...
u have to create a user defined message:
#define MY_MSG WM_USER + 100 OR something.... as u wish...
this is one of the arguments in the API call....
we can achieve this also using synchronous sockets , but asynchronous is much more easy....
|
|
|
|
|
monrobot13 wrote:
Is there a ReadLine function to read a single line from a socket?
To my knowledge, sockets do not know what "lines" are. That is a notion understood by us, and some text editors.
monrobot13 wrote:
Lastly is there a function to "peek" at the data waiting to be read?
ioctlsocket(..., FIONREAD, ...); is but one way.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|