|
You're trying to link MFC statically - nafxcwd.lib is a static MFC library, debug version. It seems you're using 'Standard Edition' of VC++ (formerly known as 'Learning Edition'). This version doesn't support static linking to MFC. There's an interesting article somewhere on CodeProject dealing with this.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
How do I create a unique key in a DaoDatabase?
Thanks.
Richard
|
|
|
|
|
I create a toolbar in the Internet Explorer.When I click one button on this toolbar,I want to show a modal dialog.I use following code in the toolbar's button click events.
CMyDialog dlg;
int ret=dlg.DoModal();
I get ret=-1.
When I create the dialog in the Band.cpp file and make the "dlg" as a global variable, then in the click event I use dlg.ShowWindow(SW_SHOW), It will show the dialog modaless.Now another problem is out.I can't use the "TAB" key to change focus between the controls on the Dialog Box.
What's wrong with it?
|
|
|
|
|
for the solution of the second problem see "Q187988 - PRB: ActiveX Control Is the Parent Window of Modeless Dialog"
|
|
|
|
|
Ok, I have this ListBox and I want to transfer the String that was selected in this List to a new Dialog.
The Problem is everytime I do dlg.DoModal(); the String reset's to NULL!
Maybe someone can help me!
Thanx
Enzi
|
|
|
|
|
Hi,
The easiest way is to create a member variable CString (or whatever) in each dialog.
Then when you've got the string you want from the list, call:
CMyDialog dlg;
then:
dlg.m_strString = strList;
where m_strString is the member variable for the string in the second dialog and strList is the string that holds the value from the list box.
Then you can call:
dlg.DoModal();
In the second dialog you can no do what you want with m_strString.
Cheers,
Peter
|
|
|
|
|
Ahh thanx!
So if u understood right.
For each variable I want to use in Dialog2 from Dialog1, I've got to make a Variable in the ckass of Dialog2.
Ok thanx for the help!
btw Windows Programming is complicated!!
Enzi
|
|
|
|
|
I would like to concatenate 2 strings like that:"1" and "y" so i would like to know how i have to declare my variables, as string or CString or as LPCSTR?
thanks for your answer
gerald
|
|
|
|
|
Its entirely up to you as to whether you use CString or LPCSTR's
if you use CStrings:
CString a,b,c;
a="hello";
b="world";
c=a + b;
// c is now "helloworld"
or, if you use LPCSTR's:
char a[]="hello";
char b[]="world";
LPCSTR c; // LPCSTR is just a long pointer to a char
c=new char[80]; // some allocation
c=a+b; // is wrong and will probably crash your program
strcpy(c,a);
strcat(c,b);
// c now points to a string "helloworld"
|
|
|
|
|
I'm making a utility plugin dll for 3d studio and I want to use a tree control in it. I have a dialog which contains the treeview, but I don't know how I can use it from the code. I can get the HWND of the ctreectrl, can I distill some kind of workable pointer from it, or something like it? The problem is that the dialog is added as a panel inside 3dstudio max, all I have is a HWND of the dialog.
Thanks,
WAVK
|
|
|
|
|
|
Hi,
I work with Visual C++6.0 SP5 under Windows 2000 SP2
I have theis following problem to compile my project in visual c++6.0
I want to connect to a data source (sqlserver or db2). If i attemp to compile my project, the following error message is display :
------------------------------------------------------------------------------
f:\progra~1\sqllib\include\sqlext.h(1676) : error C2146: syntax error : missing ';' before identifier 'SQL_API'
f:\progra~1\sqllib\include\sqlext.h(1676) : error C2501: 'SQLRETURN' : missing storage-class or type specifiers
f:\progra~1\sqllib\include\sqlext.h(1676) : fatal error C1004: unexpected end of file found
------------------------------------------------------------------------------
Sqlext.h is'nt part of my project
Can anybody help me ?
Thanks in advance
|
|
|
|
|
It probably is part of your project, you just can't see it. Check your include files it is being added by some other file. You may need to change the order of your includes.
|
|
|
|
|
You should make sure Sql.h and Sqltypes.h are included whereever you are trying to use ODBC
Bret Faller
Odyssey Computing, Inc.
|
|
|
|
|
In my application I'm accessing to several database servers through ODBC (oracle, sql-server, sybase, ...) and I need to access to some system tables, that's the reason what I need to know in which of those systems I'm connected.
I can try to access to a specific table with a "try ... catch" but it's not a "pretty" solution.
Any idea?
Thanks.
|
|
|
|
|
Is can I to return a parameter in the program termination in exe file ?
|
|
|
|
|
look in help for main, wmain etc. - they return int
t!
|
|
|
|
|
Can you explain your answer ???
|
|
|
|
|
your program can look like this:
int main(void)
{
return 7;
}
calling .bat can work with it:
program.exe
if errorlevel 7 goto END
also you can do this:
void main(void)
{
exit(7);
}
it is better now?
t!
|
|
|
|
|
I have recently moved away from MFC, and focussed on Win32 programming instead. But I am having problems with safe drawing of DCs, particularly the SelectObject() and DeleteObject() functions. I know that whenever you create an object and select it, you must get the old object so you can put it back when your finished. I found some source code for this and it went something like this:
HBRUSH hbrNew = CreateSolidBrush(RGB(255, 0, 0));
HBRUSH hbrOld = SelectObject(HDC, hbrNew);
// Drawing Stuff...
SelectObject(HDC, hbrOld);
DeleteObject(hbrNew);
But this doesn't work with the compiler. It has a problem with the hbrOld being a HBRUSH. If anyone can help or tell me how to do it properly, it would be greatly appreciated.
James Bird - birdjames@bigfoot.com
|
|
|
|
|
SelectObject returns HGDIOBJ - you have to cast the return value to HBRUSH --or-- declare hbrOld as HGDIOBJ.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Correct. Either way you will have to use a cast:
method 1:
HBRUSH hMyBrush = CreateSolidBrush(RGB(255,255,255));
HBRUSH hBrushOld = (HBRUSH) SelectObject(myDC,hMyBrush);
//Draw Here
SelectObject(myDC,hBrushOld);
DeleteObject(hMyBrush);
method 2:
HBRUSH hMyBrush = CreateSolidBrush(RGB(255,255,255));
HGDIOBJ hBrushOld = SelectObject(myDC,hMyBrush);
//Draw Here
SelectObject(myDC,(HBRUSH)hBrushOld);
DeleteObject(hMyBrush);
|
|
|
|
|
Either way you will have to use a cast
Not true. Version 2 doesn't need a cast to HBRUSH
HBRUSH hMyBrush = CreateSolidBrush(RGB(255,255,255));
HGDIOBJ hBrushOld = SelectObject(myDC, hMyBrush);
SelectObject(myDC, hBrushOld);
DeleteObject(hMyBrush);
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Hi all,
I want to use of use of two table in only one CDaoRecordset object ...
Does i must use of two object ???
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
You can use a join as: "SELECT * from table_one,table_two where table_one.column=table_two.column"
Therefore Overload the GetDefaultSQL() function of CDaoRecordset and return "table_one,table_two"
|
|
|
|