|
create a class that inherits from CDialogBox, then call this in your code :
CMyDialog dlg;
dlg.DoModal();
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
You mean CDialog and not CDialogBox (class CDialogBox doesn't exist).
The easiest way is to create a dialog box resource in the resource editor and then open ClassWizard (while the focus is on your dialog resource). It will ask you if you want to create a new class for this resource. Say yes and fill all what is required for you. That's it.
But your question is really vague, so if you want more specific answers, ask specific questions.
|
|
|
|
|
Hi
I have a dialog based MFC application in which I have one Microsoft Web Browser ActiveX control and I navigate sites using it.
Now I want to programm is such that when I press function key "F3", it should hide my cursor and when next time I press "F3" it should show my cursor back.
Now to capture key press event i use PreTranslateMeaasge() function and in that I get VK_F3 as virtual key code for F3. Now I hide my cursor using ShowCursor(FALSE) or and when again F3 key is press I use ShowCursor(TRUE) to show my cursor back....It hides my cursor when I press F3 key but my problem is : It takes few seconds to hide my cursor and also few more seconds to show after pressing F3. Also if I move my mouse even slight faster, it shows my mouse pointer in between.
I have also put code in WM_MOUSEMOVE message so that when mouse is moved it checks one boolean variable and then shows or hides cursor.....
Still same problem arries....any idea......?
What seems to be the problem....What should I do to overcome this problem ?
Thanking you
Amarelia Maehsh
Gujarat
India
|
|
|
|
|
Is Unix/Linux losing battle ground to Windows???
|
|
|
|
|
Linux has so far expanded at the expense of Unix while MS server-side revenues are still growing. Both Linux and Windows are growing at the expense of commercial Unix.
So, Unix is losing to Linux and Windows.
Linux is not losing to Windows.
Windows is not losing to Linux - so far.
Kevin
|
|
|
|
|
Hmmm, I personally enjoy doing development work on Windows as it is user friendly. But possibly in the very near future I will have to choose to work on either Unix/Linux or on Windows.
To keep sharp in the competition, it's best to keep one set of skills polished at all time, that's my opinion personally. Some people may not agree. I just dont think it is that easy to switch back to Windows/Unix after quite a few years working on the other, at least the employer who does the hiring thinks this way. Do you agree?
So,,,windows,,,unix,,, I dont want to spent next 5~6 years on Unix then find out I am trapped in an isolated ever-shrinking island where across the sea is the vast landscape of windows' world,,, I am just nagging myself here. This has nothing to do with C++/VC theme,,,
|
|
|
|
|
Laffis wrote:
Hmmm, I personally enjoy doing development work on Windows as it is user friendly.
So do I. My one brief experience of Unix development was pretty unpleasant. But this was over 6 years ago.
Laffis wrote:
But possibly in the very near future I will have to choose to work on either Unix/Linux or on Windows.
I try to go where the market demand is. There's more than enough work in Windows at the moment, and probably will be for some time.
Laffis wrote:
I just dont think it is that easy to switch back to Windows/Unix after quite a few years working on the other, at least the employer who does the hiring thinks this way. Do you agree?
It's more the way employers think. They think if you haven't used some skill in the past 6 months then you can't use it at all!
Laffis wrote:
dont want to spent next 5~6 years on Unix then find out I am trapped in an isolated ever-shrinking island
Linux rather than Unix would be the way to go if you wanted to try something other than Windows, as it's a growing market.
Kevin
|
|
|
|
|
you talk about servers or common users computers ?
which points do you compare to ?
your question have no content sir...
moreover, this is a general question (not a programming one), so you could have asked it on the Lounge[^]...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
As I understand it, Linux is growing on the server side at the expense of Unx rather than Windows. On the desktop very little is changing.
Kevin
|
|
|
|
|
I have a single document application. I want to create a log window in my app similar to Output window in VC++ IDE.I need to update it at runtime, and scroll it down automatically.
How can i do this?
Thanks a lot for your efforts.
All efforts are valueable.
|
|
|
|
|
You can derive your class from CScrollView. Then use a splitter window class to split your window. It's too long to explain how to do that exactly (and too specific) but there is a lot of documentation in the MSDN.
|
|
|
|
|
Here is an alternative.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
How to convert a *.dat file to *.bmp file, so that the *.bmp file can be opened in Paint.
aasstt
|
|
|
|
|
this doesn't mean nothing... a .dat can contain whatever the one who created it wanted to put in it... if it already contains a bitmap, so just rename the file...
otherwise, you'll have to know what format is used in the dat file.
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
do this,
in the command prompt, type
c:\..\..ren *.dat *.bmp,
and now all the .dat files are .bmp files..
V
|
|
|
|
|
hi,
first: how to create dialog based app in win32 without using resource
and to add radio button and listbox
second: after this how modeless dialog can be created from rom that modal and to transfer data from modal and to modeless in win32
|
|
|
|
|
tamsel wrote:
to add radio button and listbox
I know the answer of this Question But forget the Api...
tamsel wrote:
how to create dialog based app in win32 without using resource
use CreateWindow (if using Win32 api) with BUTTON as Class ....
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
You could use CreateDialogIndirect to create the dialog window. It uses a template in memory in standard form but not neccessarily a resource identifier. Adding additional controls on the fly can be done with CreateWindow and specifying the appropriate class.
Not sure what you mean on your second question. There is very little difference in the dialog template between modal and modeless.
|
|
|
|
|
douglasjordan wrote:
CreateDialogIndirect to create the dialog win
Nice, I forget that api ... thanks
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hello, I wrote a function for drawing and resizing Bitmaps with VC++ 6 on Windows XP.
It works fine on Windows XP and Windows 2000. But when I try it on Windows NT4 Sp6 there is noching paited. I receive no errors and the created Bitmap Handle is not NULL. There just draws nothing on the screen.
I´m using the IPicture Interface for loading the Bitmap/jpg Files.
Does anyone have an idea where this might come from?
Do I need to update some dlls on the NT machine maybe some MFC dlls?
I´m rather new to Windows/MFC programming. So please excuse me if it´s a silly question.
-- modified at 4:33 Wednesday 28th September, 2005
|
|
|
|
|
After a lot of testing I narrowed down the problem. The Problem is not the Loading of the Bitmap. It is the resizing. Drawing the bitmap in its original size works fine.
Here is what I do:
LoadImageFromFile( &lbmpGraphic, fileName );
// lbmpGraphic contains the loaded bitmap (HBITMAP)
// this can be drawn on Windows NT
/*++++++++++++++ Begin Resizeing ++++++++++++++*/
// initialiZE Bitmap pointer
tempDC = CDC::FromHandle( GetDC( lhWnd ));
lpbmObject = new CBitmap;
// CREATE compatible Memory Devicecontext for the target
pCdcDest = new CDC;
pCdcDest->CreateCompatibleDC( tempDC );
// create compatible Memory Devicecontext for the source
pCdcSource = new CDC;
pCdcSource->CreateCompatibleDC( tempDC );
// Create compatible bitmap for the target dc
lpbmObject->CreateCompatibleBitmap( tempDC, lrectTarget.Width(), lrectTarget.Height() );
// Initialize target dc and save old bitmap
lpbmpDestSave = pCdcDest->SelectObject( lpbmObject );
// get bitmap Info for dimensions
GetObject (lbmpGraphic, sizeof (BITMAP), &lbmpTempBitmap);
// Select Bitmap into source DC
lpbmpSourceSave = pCdcSource->SelectObject(CBitmap::FromHandle(lbmpGraphic));
// Set stretchmode
SetStretchBltMode( pCdcDest->operator HDC(), COLORONCOLOR );
// StretchBlt Picture in Dest DC
lnStretchResult = pCdcDest->StretchBlt(
0,
0,
lrectTarget.Width(),
lrectTarget.Height(),
pCdcSource,
0,
0,
lbmpTempBitmap.bmWidth,
lbmpTempBitmap.bmHeight,
SRCCOPY );
if ( !lnStretchResult )
{
test_msg(ERROR, "ERROR in StretchBlt!");
}
// Draw a black frame
pCdcDest->LineTo(lrectTarget.Width() - 1, 0);
pCdcDest->LineTo(lrectTarget.Width() - 1, lrectTarget.Height() - 1);
pCdcDest->LineTo(0, lrectTarget.Height() - 1);
pCdcDest->LineTo(0, 0);
// get bitmap from target dc
lpbmpRes = pCdcDest->SelectObject(lpbmObject);
// make a copy ( lpoutBitmap stores the result of the function )
*lpoutBitmap = (HBITMAP)CopyImage(lpbmpRes->operator HBITMAP(),
IMAGE_BITMAP,0,0, LR_COPYRETURNORG);
//Cleanup
pCdcSource->SelectObject( lpbmpSourceSave );
pCdcDest->SelectObject( lpbmpDestSave );
tempDC->DeleteDC();
DeleteObject( lbmpGraphic );
pCdcDest->DeleteDC();
delete pCdcDest;
pCdcSource->DeleteDC();
delete pCdcSource;
lpbmObject->DeleteObject();
delete lpbmObject;
lpbmpRes->DeleteObject();
Something in this code does not work on NT. Maybe I deleted to much or to less objects or in the wrong order?
Does anyone have a suggestion?
Please help.
|
|
|
|
|
When I delete the last lines:
lpbmObject->DeleteObject();
delete lpbmObject;
lpbmpRes->DeleteObject();
The Bitmap will be drawn but I will leak 1 GDI Object each call. I can not have that.
btw I like talking to myself but it doesn´t help that much...
|
|
|
|
|
I am programming a Socket enabled with SSL on server side
//get the credentials
SecurityFunctionTable m_SecurityFunc;
Status = m_SecurityFunc.AcquireCredentialsHandle(
NULL,
UNISP_NAME,//schannel package requested
SECPKG_CRED_INBOUND,//for server
NULL,
&m_SchannelCred,//structure contains the data required for //SChannel
NULL,
NULL,
phCreds,//pointer to CreHandle which receives the handle to credentials
&tsExpiry);
if(Status != SEC_E_OK )
{
::OutputDebugString(_T("error"));
}
i m getting an error .I checked the returned value of status ,it is SEC_E_INTERNAL_ERROR
i m not understand where is the problem.
Thanx in advance for any suggestion
|
|
|
|
|
When you define a dialup or broadband internet connection on your computer a name is assigned to it. This name apears in the Control Panel-> Network Connections section . I want to know how can I get programmaticaly this names .
Can anyone help me?
|
|
|
|
|
USe the SetupDi functions to get the names. They are a pain in the arse to use mind you, you will need some sample code to help you. Look in the DDK, there is some code in it .
Nunc est bibendum
|
|
|
|