|
I have heard of such a utility, but never seen it.
If it just the one application you could put a copy of the 5.0 debug dlls in that applications debug directory. If you are running the 5.0 debug version beyond that testing environment put it in a seperate directory and put a copy of the debug 5.0 dlls there.
|
|
|
|
|
Hello all,
How do I detect a CD-RW drive? How do I read/write files onto a CD-RW? Any code or links would also be helpful.
TIA.
#define MOSTLY_LEAN_AND_MEAN
|
|
|
|
|
I've created sdi app using mfc AppWizard and have created my own classes in a header file called game.h.
What I want to do is create an instance of that class in my CChildView (CWnd) class.
ie.
(in the file ChildView.h)
#include "game.h"
CChildView : CWnd
{
//blah blah
protected:
CGame *game;
};
When I do this though I get this error
"error C2011: 'CGame' : 'class' type redefinition"
The reason I'm trying to do this is that I need all of my CChildView functions to have access to this CGame instance and it seems like an easy way to do it.
Any suggestions?
|
|
|
|
|
The file is getting included more than once. Does your class have a #ifndef CGAME$%)(^@($% type macro wrapping it ?
Try including the header file in your .cpp file and putting a dummy class definition in the .h, as in
class CGame;
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
As we know..
MFC have the GetDlgItemText function to retrieves the string (char datatype)
and GetDlgItemInt function to translate the text into integer value. (integer datatype)
But I wonder is there any function for Float datatype?
If you know .. please explain along with the parameter within the function.
Thanks..
|
|
|
|
|
No there is not such function, but you can use atof() to convert the string you got from GetDlgItemText() to a float
hope this helps
regards
Gregor
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I would like to convert the integer value to float value.
I got some error when I used atof function.
Do u know any function that same as atof() that convert integer to float?
Thanks a lot.
Lee Teong
|
|
|
|
|
Maybe something like this:
int i = 10;
float f = 0.0;
f = (float) i;
|
|
|
|
|
I would have to say that this is one of the cases that you may want to use the DDX_ functions. One of the overrides does exactly just that.
But there are limitations to those functions so if you are hitting on those limitations, you may still have to roll your own code.
|
|
|
|
|
Hi!
Me and a friend are trying to build a robot that communicate with the computer using the parallel port.
I have used the outp() command before but I do not want to use the port address since I have experienced problems on different computers when the address are different.
So I have heard I can use WritePrinter to send data to the parallel port. But All I get when I try to use it is trouble. When it seems like I have everything right I get linker error (2001 I think not sure though). So what I need is a complete guide for how to get this to work since I am not into this win32 API stuff att all.
I use MFC visual c++, and am running Win ME.
examples are appreciated
Thanks,
hywer
|
|
|
|
|
|
thanks for the reply. I have sent you a msg but in case you didn't get it my email is o_ernstsson@iamit.com
|
|
|
|
|
I found a <http: www.codeproject.com="" script="" comments="" forums.asp?forumid="1647&app=50&kw=colors&select=98566#xx98566xx"" target="_new">thread from a few days ago about getting a CListCtrl to draw more than 16 colours from its associated CImageList.
CBitmap bitmap;
bitmap.LoadBitmap(IDB_CERT_PG);
m_pImageList = new CImageList;
m_pImageList->Create(16,16, ILC_COLORDDB | ILC_MASK, 2,2);
m_pImageList->Add(&bitmap, RGB(0,0,0));
m_pImageList->Add(&bitmap, RGB(0,0,0));
m_listctrl.SetImageList(m_pImageList, LVSIL_SMALL);
The CListCtrl draws the bitmaps in 16 colours. I have tried setting up a halftone palette, but that didn't work either. Am I going to have to override CImageList's OnDraw() to draw the bitmap myself in over 16 colours?
Simon
Nobody does chicken like MFC
Sonork ID 100.10024
|
|
|
|
|
|
That's the problem - ILC_COLOR24 doesn't work. CListView still insists on 16 colours.
Simon
Nobody does chicken like MFC
Sonork ID 100.10024
|
|
|
|
|
Hi!
I've tried to get my app to do what Start->Run does, but failed. The string entered in the Start->Run editbox must be passed to some function in a dll somewhere. Does anyone know which?
ShellExecute(), CreateProcess() and system() won't do.
|
|
|
|
|
The "Start->Run" doing nothing but simple ShellExecute() . What you mean that it isn't working? So or you passed wrong parameters to it or the path doesn't exists.
Post an example of what are you doing with ShellExecute()
Philip Patrick
"Two beer or not two beer?" (Shakesbeer)
Web-site: www.saintopatrick.com
|
|
|
|
|
hWnd is a common editbox
int commandLength = ::GetWindowTextLength(hWnd);
LPTSTR szCommand = new TCHAR[commandLength + 1];
::GetWindowText(hWnd, szCommand, commandLength + 1);
LPTSTR szParameters = strchr(szCommand, ' ');
if (szParameters)
{
szParameters[0] = '\0';
szParameters++;
}
::ShellExecute(NULL, NULL, szCommand, szParameters, NULL, SW_SHOWNORMAL);::SetWindowText(hWnd, TEXT(""));
delete[] szCommand;
The command is run, but if I type an errouneous command, no errormessages are displayed. I would like ShellExecute to do that for me. I've tried several different parent-window handles as parameter, but no messagebox are displayed.
|
|
|
|
|
ShellExecute doesn't do the messagebox for you.
You need to check the return value and then display a messagebox by yourself
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Thank god it doesn't no less!!! Would sort of make headless applications hard to write.
Tim Smith
Descartes Systems Sciences, Inc.
|
|
|
|
|
I have "simple object",when I created it I accepted all default attribute.
Now I want to add Method with "callback" attribute,but after compile it return error:
method definition--->[id(4), helpstring("method KeyboardProc"), callback] HRESULT KeyboardProc(int nCode,WPARAM wParam,LPARAM lParam);
error---->error MIDL2304 : attribute invalid on a proc in an [object] interface : : [callback] [ Procedure ...
I also test this and get this error:
method definition--->[callback(4), helpstring("method KeyboardProc")] HRESULT KeyboardProc(int nCode,WPARAM wParam,LPARAM lParam);
error---->error MIDL2025 : syntax error : expecting ] or , near "("
***I also want the return vale to be "LRESULT" but I can not change "HRESULT" when I want to add Method.*****
|
|
|
|
|
I'm not quiet sure what you are trying to achieve here.
COM IDL is limited to certain data types and callback certainly isn't one of them. COM methods can only return HRESULTS, if you want to return a value it needs to be passed back as a pointer via the parameter list.
Michael
|
|
|
|
|
If you look up error 2304, it reads;
MIDL2304: attribute invalid on a procedure in an [object] interface
The specified attribute is not allowed on procedure in a COM interface.
Tim Smith
Descartes Systems Sciences, Inc.
|
|
|
|
|
I want my method return Keyboard messages?(It hook keyboard message)
What attribute my method should have and what it should return?
|
|
|
|
|
Hi, I was wondering if anyone out there knew of a place where I might either buy or obtain (open-source) a copy of an "intellisense" control, similar to that of Visual Studio? I am in the process of working on an editor and such a control would be awesome.
|
|
|
|