|
I need to create a window that docks to the right of the desktop, pushing all existing windows to the left.
One solution is to use a desk band, but it has some undesirable features, such as, another desk band can come and merge into mine.
Is there a way to make a custom window behave like the desk band, or to make restrictions to the deskband such that it can be docked only on the right, and no other deskbands can be merged into it?
Thanks.
|
|
|
|
|
How can I enter data into VtChart control (TVtChart) dynamically
in Borland C++
tijo joseph
|
|
|
|
|
you are on the Visual C++ forum... not borland's. sorry
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
tutorial.rc(29): error RC2135 : file not found: ID_MENU
tutorial.rc(33): error RC2135 : file not found: MENUITEM
tutorial.rc(20): error RC2144 : PRIMARY LANGUAGE ID not a number
tutorial.rc(31): error RC2164 : unexpected value in RCDATA
Here is the resource file. It is kind of big:
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "tutorial.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
ID_MENU MENU DISCARDABLE
BEGIN
POPUP "&File"
BEGIN
MENUITEM "&Start Smart Logger", ID_FILE_START
MENUITEM "Stop Smart Logger", ID_FILE_STOP
MENUITEM SEPARATOR
MENUITEM "&Save", ID_FILE_SAVE
MENUITEM "E&xit Smart Logger", ID_FILE_EXIT
END
POPUP "&Choose Dave Card"
BEGIN
MENUITEM "&P3", ID_CHOOSEDAVE_P3LOG
MENUITEM "&P4", ID_CHOOSEDAVE_P4LOG
MENUITEM "&P5", ID_CHOOSEDAVE_P5LOG
END
POPUP "&Choose Charlie Card"
BEGIN
MENUITEM "&ROM2", ID_CHOOSECHARLIE_ROM02LOG
MENUITEM "&ROM3", ID_CHOOSECHARLIE_ROM03LOG
MENUITEM "&ROM10", ID_CHOOSECHARLIE_ROM10LOG
MENUITEM "&ROM11", ID_CHOOSECHARLIE_ROM11LOG
END
POPUP "&Help"
BEGIN
MENUITEM "&About Smart Logger", ID_HELP_ABOUT
END
END
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""tutorial.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_DIALOG1 DIALOGEX 0, 0, 232, 129
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION |
WS_SYSMENU
CAPTION "Dialog"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON "OK",IDOK,19,111,70,14
PUSHBUTTON "Cancel",IDCANCEL,128,111,73,14
CONTROL "Ins00",IDC_CHECK1,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,9,4,34,10
CONTROL "Ins02",IDC_CHECK2,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,9,17,34,10
CONTROL "Ins04",IDC_CHECK3,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,9,30,34,10
CONTROL "Ins06",IDC_CHECK4,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,9,43,34,10
CONTROL "Ins08",IDC_CHECK5,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,9,56,34,10
CONTROL "Ins0A",IDC_CHECK6,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,9,69,34,10
CONTROL "Ins0C",IDC_CHECK7,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,9,82,34,10
CONTROL "Ins0E",IDC_CHECK8,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,9,95,34,10
CONTROL "Ins10",IDC_CHECK9,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,45,4,34,10
CONTROL "Ins12",IDC_CHECK10,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,45,17,34,10
CONTROL "Ins14",IDC_CHECK11,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,45,30,34,10
CONTROL "Ins16",IDC_CHECK12,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,45,43,34,10
CONTROL "Ins18",IDC_CHECK13,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,45,56,34,10
CONTROL "Ins1A",IDC_CHECK14,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,45,69,34,10
CONTROL "Ins1C",IDC_CHECK15,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,45,82,34,10
CONTROL "Ins1E",IDC_CHECK16,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,45,95,34,10
CONTROL "Ins20",IDC_CHECK17,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,81,4,34,10
CONTROL "Ins22",IDC_CHECK18,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,81,17,34,10
CONTROL "Ins24",IDC_CHECK19,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,81,30,34,10
CONTROL "Ins26",IDC_CHECK20,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,81,43,34,10
CONTROL "Ins28",IDC_CHECK21,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,81,56,34,10
CONTROL "Ins2A",IDC_CHECK22,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,81,69,34,10
CONTROL "Ins2C",IDC_CHECK23,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,81,82,34,10
CONTROL "Ins2E",IDC_CHECK24,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,81,95,34,10
CONTROL "Ins30",IDC_CHECK25,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,117,4,34,10
CONTROL "Ins32",IDC_CHECK26,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,117,17,34,10
CONTROL "Ins34",IDC_CHECK27,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,117,30,34,10
CONTROL "Ins36",IDC_CHECK28,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,117,43,34,10
CONTROL "Ins38",IDC_CHECK29,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,117,56,34,10
CONTROL "Ins3A",IDC_CHECK30,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,117,69,34,10
CONTROL "Ins3C",IDC_CHECK31,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,117,82,34,10
CONTROL "Ins3E",IDC_CHECK32,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,117,95,34,10
CONTROL "Ins40",IDC_CHECK33,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,153,4,34,10
CONTROL "Ins42",IDC_CHECK34,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,153,17,34,10
CONTROL "Ins44",IDC_CHECK35,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,153,30,34,10
CONTROL "Ins46",IDC_CHECK36,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,153,43,34,10
CONTROL "Ins48",IDC_CHECK37,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,153,56,34,10
CONTROL "Ins4A",IDC_CHECK38,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,153,69,34,10
CONTROL "Ins4C",IDC_CHECK39,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,153,82,34,10
CONTROL "Ins4E",IDC_CHECK40,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,153,95,34,10
CONTROL "Ins50",IDC_CHECK41,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,189,4,34,10
CONTROL "Ins52",IDC_CHECK42,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,189,17,34,10
CONTROL "Ins54",IDC_CHECK43,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,189,30,34,10
CONTROL "Ins56",IDC_CHECK44,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,189,43,34,10
CONTROL "Ins58",IDC_CHECK45,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,189,56,34,10
CONTROL "Ins5A",IDC_CHECK46,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,189,69,34,10
CONTROL "Ins5C",IDC_CHECK47,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,189,82,34,10
CONTROL "Ins5E",IDC_CHECK48,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,189,95,34,10
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
BEGIN
IDD_DIALOG1, DIALOG
BEGIN
BOTTOMMARGIN, 128
END
END
#endif // APSTUDIO_INVOKED
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
Thanks
|
|
|
|
|
CNewbie wrote:
tutorial.rc(29): error RC2135 : file not found: ID_MENU
tutorial.rc(33): error RC2135 : file not found: MENUITEM
Can you confirm that ID_MENU is present in the resource.h file?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I try to build a menu bar wich contains in adding to menu items also some controls as Menu Bar with controls as ComboBox and Buttons (see as example the menu bar of Word XP which contains a combobox for help question).
If someone has an idea please help me!
RDANA
|
|
|
|
|
First off, what you are creating is a rebar control. This rebar control has two bands. First band is a menu bar control, and the second band is a combobox control.
Note that a menu bar control is NOT a CMenu object. MFC does not directly support a menu bar (as far as I remember), so you must design one yourself. A menu bar, basically, is a toolbar with a collection of text-only buttons. When clicking on a button, a pop-up menu is launched. This menu can be loaded from a resource, just like a normal pop-up menu would be.
To create a menu bar object, follow the implementation sample from MSDN here[^].
After this, create a CReBar control. From the frame window, remove the menu. Instead, add the CReBar, add the newly created menu bar control, and add the combo box control. You can add more controls if you want to. Then add the CReBar control into the frame window. Voila, you're done.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Antti Keskinen wrote:
Note that a menu bar control is NOT a CMenu object. MFC does not directly support a menu bar (as far as I remember), so you must design one yourself.
that's it. any "movable" menus also are not CMenu s...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I now can obtain a pointer points to the place where a bitmap stored in the memory, but I'm wandering how to display it on a dialogue based programme.
Thank you for your attention.
the simplier the better!
|
|
|
|
|
Select the bitmap into a new device context, (must be compatible, CreateCompatibleDC() does this);
then just CDC->BitBlt(); on the OnPaint() proc of the dialog app
|
|
|
|
|
rw104,thank you for your instructions, but I want to display the bitmap on a dialogue, so can you give me some more delights.
the simplier the better!
|
|
|
|
|
CDC imgDC;//temp CDC to render the bitmap into
imgDC.CreateCompatibleDC(pdc); //pdc is the standard screen dialog CDC, imgDC needs to be compat..
CBitmap yourBitmap;
yourBitmap.LoadBitmap(IDB_RESOURCEIMAGE);
//IDB_RESOURCEIMAGE is an image resource
//You already have a pointer to a bitmap so you do not need these two lines.
imgDC.SelectObject(yourBitmap);//bitmap gets selected into the dc
//bitblt the image , you 'll need to decide co-ordiantes
pdc->BitBlt(0,0,100,100,&imgDC,0,0,SRCCOPY);
That's it;P
|
|
|
|
|
There have been articles on transparent windows. In these cases, the topmost window is given varying degrees of transparency so the lower window is still visible. However, is it possible to add an overlay, something like a corporate logo for instance, that would do nothing but show the logo covering the screen. All controls and data entry would be at one or more of the lower-level windows. If the logo screenshot goes behind bacause the active window is pulled up, the effect is lost so I would want to avoid that. If a new window is popped up, I would still want the overlay remaining on top. The overlay kind of just sits on top, pretty much like you pasted a transparecy on the face of the monitor.
If the logo is the first one to be painted on the screen, all other windows would have to be made transparent, which might be difficult and multiple windows at 80% transparency does lead to opacity at some point.
Is there any way to accomplish what I want?
Thanks.
|
|
|
|
|
I have some codes that print some words, lines and a bitmap to the printer. But everything printed fine except the bitmap even it works fine in print preview.
Can you help me?
Thanks
|
|
|
|
|
What's the problem ? Is the bitmap really tiny ? If so, you need to get the size of the printer DC and stretchblt your image onto it.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
No, the image size is ok and the print preview works quite well, but it did not appear on the actual paper (bitmap lost).
|
|
|
|
|
What`s the code? What`s the problem? You couldn`t use the same CDC for printing bitmap with the CDC for printing lines and words.
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
I expect that the bitmap is tiny on the print out? is this what is happening?
if so it is because you are drawing the bitmap into a printing device context, in which case a much higher resolution is used, you need to use the CDC function
StretchBlt() to draw the bitmap into a resolution equivalent rectangle which you will need to work out. So look up StretchBlt()on MSDN its is very simple.!! this
function simply stretches the bits in the bitmap accordingly.
Print preview probably works because it uses a screen DC just like what you are drawing on.
P.S. I hope this is the problem you are getting, if not soz!!
|
|
|
|
|
Soz!,other replies were not there when I replied, Im just not quick enough, well I was eating lunch!!
|
|
|
|
|
I do use the StretchBlt to copy bitmap from memory dc to the actual dc I got from CPrintDlg::CreateDC(), I think may be the problem is the image I want to print is colored, and the device is just only a black-white printer.
|
|
|
|
|
Hi,
I thought this was solved but there happens to be so mnay ways in which these two functions can fail
Here is the scenerio.
I need to connect to the server to find out if winzip command line utilities are installed or not. I use brute force method of connecting to the server running a dummy command using CreateProcess to run the command like c:\progra~1\winzip\wzzip.exe file.zip file.txt (assume file.txt exist).
It turns out to be faster than checking for presence of exes and dependencies.
It works like charm most of the times accept for one scenerio.
This deals with connection problems rather than createprocess etc.
I can do that only if I have valid access to drive c: on server to run the wzzip.exe.
So, I use WNetAddConnection2 to connect to the \\servername\c$ with proper administrative rights ( administrative usernames and password to the server, server is on LAN). After completing processing I dc using WNetCancelConnection2 .
The problem is if i go to winexplorer type in \\servername\c$, it prompts me for username and password. I enter the info and do what i do on c: of server and close the explorer. Now somehow windows remeber this connection and even a call to WNetCancelConnection2 fails to delete it. So when i call WNetAddConnection2 it returns the erro saying the credentials provided conflict with existing crediantls. But if i restart the computer and then run the app it conencts fine and do what it is suposed to do.
Is there a way I can make windows forget the connection (it's not even mapped ).
WNetCancelConnection2 is supposed to delete all non persistent conenctions liekt his, but It does not seem to be doing so.
Does anyone has an idea what's going on here???
Thankyou in advance
P.S. :can provide sample code, thought should explain teh scenerio first.
|
|
|
|
|
A clip from an older project. Deletes all connections. Modify to suite your needs.
Hope this helps.
/+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
// DeleteAllConnections()
// Purpose: Delete all network connections
// Added : 4/06/04
//+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
void TestDlg::DeleteAllConnections()
{
DWORD dwResult;
HANDLE hEnum;
DWORD cbBuffer = 16384;
DWORD cEntries = 0xFFFFFFFF;
LPNETRESOURCE lpnrDrv;
#if _DEBUG
return;
#endif
dwResult = WNetOpenEnum( RESOURCE_CONNECTED, RESOURCETYPE_ANY,0,NULL,&hEnum );
if (dwResult != NO_ERROR)
{
GetErrorMsg(dwResult);
return;
}
// start enumerating all the connections
while( dwResult != ERROR_NO_MORE_ITEMS )
{
lpnrDrv = (LPNETRESOURCE) GlobalAlloc( GPTR, cbBuffer );
dwResult = WNetEnumResource( hEnum, &cEntries, lpnrDrv, &cbBuffer);
if (dwResult == NO_ERROR)
{
for( DWORD ii = 0; ii < cEntries; ii++ )
{
if( lpnrDrv[ii].lpLocalName != NULL )
dwResult=WNetCancelConnection(lpnrDrv[ii].lpLocalName, TRUE );
else
dwResult=WNetCancelConnection(lpnrDrv[ii].lpRemoteName,TRUE );
GetErrorMsg(dwResult);
}
}
}
// cleanup
GlobalFree( (HGLOBAL) lpnrDrv );
WNetCloseEnum(hEnum);
}
Erik
|
|
|
|
|
Ok this is a just a remake of the piece of source that has the problem..
char somthing[200];
char somthing2[200];
cin>>somthing;
cin>>somthing2;
cout<
|
|
|
|
|
Works for me. the only thing is that because you are not outputting newlines the output was "hellohi", as expected.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Given the following:
string Part = “*(-2)”
char buf[5] = “10”
string Result = buf after arithmetic defined in Part is performed
I need to isolate the value after “-“ in Part and perform the arithmetic on buf (knowing in advance that this is a subtraction): For example, using the string values above (pseudo-code):
1- Isolate the “2” in string Part
[actually isolate everything between the “-“ and “)”]
2- Perform the subtraction buf – 2
3- Store result in Result string
Therefore the result should be Result = 8 (10 – 2 = 8)
I need a way to perform these steps….
Any clues or help would be greatly appreciated.
Thanks,
|
|
|
|
|