|
can give some example of source code or project to write the server and client programming
|
|
|
|
|
I searched this site by typing 'client server' in the search dialog you can see just below the Code Project logo above, and found this[^].
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
After downloaded the server and client source code, I do not know how to build 2 project that one is for client and another is for server. can give some guide to build it? I really weak in computer programming and never touch Visual C++ before..
|
|
|
|
|
Are you being asked to do this by your boss or your teacher ? It's a really significant task if you've never used C++ before, if you can abandon it for something simpler, that would be sensible.
Why can't you build it ? What happens ? All you need to do is open the project and choose 'build', assuming you have the right version of VC++ ( I'm not sure which the project uses, actually )
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
It's the inevitable...
I wrote a menu in the resource file and I entered it into the CreateWindowEx function call and it shows up. I also added code to the message handler to catch clicks. However, when I click items, nothing happens. Here's the handler:
switch (Msg) {<br />
case WM_COMMAND: {<br />
HandleMenuFunctions (hWnd, wParam);<br />
return 0;<br />
} break;<br />
default: {<br />
return DefWindowProc (hWnd, Msg, wParam, lParam);<br />
} break;<br />
}
HandleMenuFunctions is just a function that has another switch to do different things based on the menu item selected:
void HandleMenuFunctions (HWND hWnd, WPARAM wParam) {<br />
switch (LOWORD(wParam)) {<br />
case ID_FILE_QUIT: {<br />
MessageBox (hWnd, "Posting Quit Message now", "Notice", MB_ICONINFORMATION);<br />
PostQuitMessage(0);<br />
} break;<br />
default: { MessageBox (hWnd, "Encountered unknown menu ID", "Notice", MB_ICONSTOP); } break;<br />
}<br />
}
(excuse that smiley face, that should be a PostQuitMessage(0); call.)
Also, when I go to click the menu, it only shows me the popup menu under File every other time. The other times I click, the menu just loses focus. I don't know if that's important or not. Thanks in advance.
edit: I put breakpoints on that first WM_COMMAND case to see if the message is ever captured and it isn't. Either I'm catching the wrong message or something is wrong with the menu. I noticed that there are ways to declare a menu when I register the class in WNDCLASSEX and also when I call CreateWindowEx. I tried only declaring the menu when I register the class and the menu doesn't show, but when I declare it only in CreateWindowEx, it shows up. That might be important too.
solution: I fixed the problem, it had to do with my main message loop, it also fixed the thing where the menu loses focus. I removed the PeekMessage call and just let GetMessage get the message. Here's what I ended up with:
while (GetMessage(msg, NULL, 0, 0)) {<br />
if (msg->message == WM_QUIT) {
return ((int) msg->wParam);<br />
}<br />
TranslateMessage(msg);<br />
DispatchMessage(msg);<br />
}<br />
|
|
|
|
|
What does this error mean and how to solve it?
fatal error C1010: unexpected end of file while looking for precompiled header directive
|
|
|
|
|
If you are using mfc, you need to include "stdafx.h" as the first in your cpp files.
<font=arial>Weiye Chen
Life is hard, yet we are made of flesh...
|
|
|
|
|
To elaborate on the prior answer - the stdafx.h file is included BEFORE any other header in every file of a standard MFC project. Any headers you include before stdafx will be ignored. This most typically becomes a problem when you import a non MFC C++ file into your project. It's C++, the compiler can handle it, except that it's expecting to see standard headers. The stdafx header is full of includes, and if you don't need it for that file, or for any files in general, you can change your project settings from using standard headers, to a setting where you specify that the file is stdafx.h, and if you don't include it in a source file, the compiler will just allow it, and compile that file without using the standard header.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
can someone plz give me a tutorial on how to accessing Paradox useing ADO.
i'd like to do it completely in Win32/SDK also
Thanks In Advance,
bin e
|
|
|
|
|
Not a tutorial, but here is how to connect to a paradox database.
Driver={Microsoft Paradox Driver (*.db)};DBQ=physical path to .db file;DriverID=26
See this web site for other database connections.
msdn.microsoft.com[^]
There are a couple of tutorials here at Code Project. The listing can be found here.
http://codeproject.com/database/#ADO[^]
Hope this helps...
-------------------------------
DEBUGGING : Removing the needles from the haystack.
|
|
|
|
|
thanks for your help i will look at the page !!
nothing
|
|
|
|
|
can someone plz give me a tutorial on how to change a pushbuttons appearance using GDI.
i'd like to do it completely in Win32/SDK also
Thanks In Advance,
Tim Zorn
|
|
|
|
|
Basically, you set the control to be owner drawn, then you draw it however you like.
This[^] article may be of some help.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
thank you for advance i have change my article.
can you help me?
nothing
|
|
|
|
|
What did you want help with ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
this is my code for useing ADO link Paradox DataBase.
but it throw wrong so maybe you can help me.
i will greatly appreciated
BOOL CTM21App::InitInstance()
{
CString connectsource;
_ConnectionPtr pCon;
AfxOleInit();
AfxEnableControlContainer();
pCon.CreateInstance(__uuidof(Connection));
try
{
connectsource.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=%d\\work\TM21Vol4\gentan500\Database;Extended Properties=Paradox 4.81;Persist Security Info=False");
pCon->Open((_bstr_t)connectsource,"","",adModeUnknown);
}
catch(_com_error e)
{
AfxMessageBox("open .db wrong");
return FALSE;
}
}
nothing
|
|
|
|
|
I'm sorry, I'm really not sure. What's the _com_error you catch, have you looked ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
how do u do owner-drawn stuff.
i looked at the article u linked to but i didnt understand much of the source
|
|
|
|
|
An alternative to making a fully owner-drawn button, is to put an icon or bitmap on a standard pushbutton.
From a quick look at some old SDK-level code, the code is something like this:
buttonHwnd = CreateWindow("button", "",<br />
WS_CHILD | WS_VISIBLE | BS_ICON | BS_PUSHBUTTON,<br />
ButtonXPos, ButtonYPos, ButtonWidth, ButtonHeight,<br />
hwndMain, (HMENU)buttonId, hAppInst, NULL);
hButtonIcon = LoadIcon(hAppInst, MAKEINTRESOURCE(IDI_ButtonIcon));
SendMessage(buttonHwnd , BM_SETIMAGE, (WPARAM)IMAGE_ICON,<br />
(LPARAM)(HANDLE)hButtonIcon);
Right at the moment I forget what all the parameters are, but if you need help, just ask.
|
|
|
|
|
thanks a bunch man. but how do u get it to have text along with an image.
also how do i get the image to stretch across the whole button
|
|
|
|
|
I put bitmaps and icons on the buttons, but the basis was standard Windows pushbuttons. I don't have time to check now, but I think I made the size of the icons / bitmap such that they neatly fitted onto the flat grey foreground of the button. I can't remember what happens if the bitmap or icon is too big for the foreground. I would guess that if the bitmap if too big, you loose the 3D "animation" effect at the edges of the button.
To have text with an image, maybe just include the text in your bitmap / icon.
I will try to have a look at what I did later today (I'm on a course for the next 9 hours.)
|
|
|
|
|
Sorry - I had a quick look, but the earliest version I have on my work PC uses Icons on buttons (that version uses the code I posted previously.)
If it is any use to you, I am sure I can find a backup disk at home with a version which puts bitmaps on buttons. Let me know if I must find it! (Or any other similar questions.)
|
|
|
|
|
i know how to put bitmaps on buttons now but i dont know how to do it the way i want.
i want a bitmap to be stretched across the button and i want to be able to put text on the button. i have found an article that does it but i dont understand the source so im asking for help.
For Example:
a program called ICQ is skinned so it has custom buttons. but when i look at it's resourses the buttons are not ownerdrawn. all i want to do is make a custom button that has text on it. i dont even need the handling for if its selected, default, etc cuz i can find that out myself
help would be appriciated
thx
|
|
|
|
|
hello people
I would like to ask for help for the next problem:
(please take a look a this image) http://xwega.com/images/menu.jpg[^]
the problem is this:
the menu bar has the same code base as the Toolbar, in fact the menubar is a toolbar with the TBSTYLE_LIST style.
the toolbar works great but the menubar as some problems sending the TBN_HOTITEMCHANGE notification.
the menu bar is loadded like this:
m_Menu.LoadMenu(nResource);<br />
<br />
SetButtons(NULL,m_Menu.GetMenuItemCount());<br />
<br />
for(UINT i=0 ; i<m_Menu.GetMenuItemCount() ; i++)<br />
{<br />
CString menuText;<br />
m_Menu.GetMenuString(i,menuText,MF_BYPOSITION);<br />
GetToolBarCtrl().AddStrings(menuText);<br />
<br />
SetButtonText(i,menuText);<br />
SetButtonInfo(i,i,TBSTYLE_FLAT | TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE | TBBS_NOPREFIX,0);<br />
}
top menu item dont have an ID so place the variable "i" as the ID of the buttons,
and this is the problem
this way the notification is not sent and i do not know when the mouse leave the menubar
however , if the ID is set as -1 it works great but then i have now way of knowing in what button the mouse stands.
any ideias?
thanks
|
|
|
|
|
First of all is this possible?
I get several regions from set of paths. I would like to do a bollean operation on them and store have a path that would contain my final region after boolean operation. I am doing this is GDI+.
Thanks in advance,
Sincerely,
Max Pastchenko
|
|
|
|