|
I normaly convert direkt too, but in a former case i had a problem with that so i thought this would be the save way
|
|
|
|
|
why not just int number = atoi(str); ?
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
|
I'm trying to adapt the size of window so it can fit with different resolutions based on the monitor size?
|
|
|
|
|
dc.GetDeviceCaps(HORZRES)
dc.GetDeviceCaps(VERTRES)
will tell you the size of the display
-c
|
|
|
|
|
Can I do the following in the OnDraw function?
CRect rc;
SystemParametersInfo(SPI_GETWORKAREA,0,rc,0);
|
|
|
|
|
yes, but don't.
OnDraw is called pretty much all the time, and you don't want to do things in the OnDraw function that will cause drawing to be required (such as resizing the window) - that leads to trouble.
-c
|
|
|
|
|
If I use this method, will it matter which function I put this in?
dc.GetDeviceCaps(HORZRES)
dc.GetDeviceCaps(VERTRES)
All I need to adapt to different resolutions is to GetDeviceCaps?
What is dc?
Thank's.
|
|
|
|
|
Hi
How can I change screen resolution or color depth(etc.) using MFC ??
Thanks
|
|
|
|
|
Search codeproject for "Easily change screen resolution".
Trust in the code Luke. Yea right!
|
|
|
|
|
I have to change the standard MFC icon located in the top left portion of the main window to another icon.
|
|
|
|
|
Simply provide a new .ICO file in the res folder.
|
|
|
|
|
I have a file which is a type Icon, I have placed that in the res folder.
Does it have to be .ICO?
Once I place the file in the res folder, how do I actually import it in my program so it replaces the IDR_MAINFRAME image of MFC?
|
|
|
|
|
Note the name of the current IDR_MAINFRAME icon (e.g., myproject.ico). Delete that file. Rename your .ICO file to the name of the old (MFC) file. Recompile.
|
|
|
|
|
Hi,
Here is the way to change the icon programmatically,
CSomeApp::InitInstance()
{
...
...
pMainFrame->ShowWindow(m_nCmdShow);
pMainFrame->UpdateWindow();
HICON hIcon = LoadIcon(IDR_CHANGED);
pMainFrame->SetIcon(hIcon, TRUE);
pMainFrame->SetIcon(hIcon, FALSE);
}
regards
~Hari~
|
|
|
|
|
yeah you can use that.
I always use the constructor of the dialog:
CDlgDialog::CDlgDialog(CWnd* pParent /*=NULL*/)
: CDialog(CDlgDialog::IDD, pParent)
{
//{{AFX_DATA_INIT(CXyKeyGeneraterDlg)
//}}AFX_DATA_INIT
m_hIcon = AfxGetApp()->LoadIcon(IDR_ICONNAME);
}
just change the IDR_ICONNAME to your ico's inserted name.
but it's all the same actually.
Btw, do you know any websites where i can download seperate .ico files like the 'key' security icon?
Greetings
Jens
|
|
|
|
|
No, I don't know any websites,
let me know if you find any.
Azi.
|
|
|
|
|
Hi!
I am new to socket programming. When I open a socket to a TCP server, is there a way to detect data whenever it's coming back?
Please help!
Thanks
|
|
|
|
|
What I/O model does the server utilize? Under a non-blocking I/O model, the server either monitors the socket. Some I/O models such as WSAAsyncSelect utilizes a process message queue to update a thread on socket activity.
Kuphryn
|
|
|
|
|
Look into the select() api call. You can detect a pending receive either blocking or unblocking in a loop based on the timeout value you specify.
|
|
|
|
|
Somebody can help me?
I need to declare a pointer to a class prior to defining the class.
I'm programming in Visual C++ 6, the code is something like this:
// header file A.h
class A : public CObject
{
....
}
// header file B.h
class __single_inheritance MyClass;
class B : public A
{
MyClass * m_pMyClass; // error C2027
.....
}
// header file C.h
class C : public Object
{
B * m_pBdata;
}
// header file MyClass.h
class MyClass : public C
{
.....
}
But, it doesn`t work, when I compile the code, Visual c++ give me the next error:
C2027: use of undefined type MyClass
Please, I need help,
Thanks a lot.
|
|
|
|
|
Just do a forward declaration:
class MyClass;
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
I didn't find anything necessarily wrong with your code except for the inclusion of a few missing .H files.
At the top of B.H, you need to include A.H, since class B is derived from class A.
At the top of MYCLASS.H, you need to include C.H, since class MyClass is derived from class C.
That's all I had to do to your code to clean up the compiler errors.
Make sense?
|
|
|
|
|
I have a Browser Helper dll that disables the context menu in IE and also several of the Accelerator and 'F' keys. I use a keyboard hook to trap for the keys and that includes F1 (Help).
The F1 trap doesn't work. The Windows Help comes up anyway. Is there a way to disable the help from coming up?
I guess I can look for the WM_HELP message, but have not done this type of thing in a dll before. Anyone have any suggestion please? Thank you very much.
AYousif
|
|
|
|
|
Try two things:
set the hook as a low level hook: WH_KEYBOARD_LL / LPKBDLLHOOKSTRUCT (find more in MSDN).
and if this don't work, then set it as a SYSTEMWIDE HOOK: hHookKeyboard = SetWindowsHookEx(WH_KEYBOARD_LL, HookKeyboardLL, hInst, NULL);
Hope this helps.
|
|
|
|