|
hello,
I have a problem ... I want to create a CDialog ... and add to it a toobar
i have tried
m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
m_wndToolBar.LoadToolBar(IDR_MAINFRAME);
where m_wndToolBar is a member of my CDialog class and IDR_MAINFRAME is the resource ID for my toolbar and... this code is in OnInitDialog event ...
the functions return OK but the toolbar isn't there ....
please help ..... thanks !!!!!!
|
|
|
|
|
m_toolBar.CreateEx(this, TBSTYLE_FLAT | TBSTYLE_TRANSPARENT , WS_CHILD |WS_VISIBLE | CBRS_FLOATING );<br />
m_toolBar.LoadToolBar(IDR_TOOLBAR);<br />
m_toolBar.SetBarStyle(CBRS_ALIGN_TOP | CBRS_TOOLTIPS | CBRS_FLYBY);<br />
RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0);<br />
|
|
|
|
|
|
Go to Administrative Tools > Services, double-click your service in the list, and fill in the Start Parameters box.
Your ServiceMain function gets called with these parameters when the service is started.
I assume OnStart is a framework-defined method (i.e. by ATL or whatever).
|
|
|
|
|
Mike Dimmick wrote:
Go to Administrative Tools > Services, double-click your service in the list, and fill in the Start Parameters box.
Your ServiceMain function gets called with these parameters when the service is started.
I assume OnStart is a framework-defined method (i.e. by ATL or whatever).
I tried that before, if you reboot the machine the arguments will be lost (it seems to be one time only).
Click here to see my articles and software tools
|
|
|
|
|
In that case, you'll have to save them somewhere on a successful start if you want them to be permanent.
The convention is to store them in the registry under HKLM\SYSTEM\CurrentControlSet\Services\<service-name>\Parameters .
|
|
|
|
|
I have a MDI application. How do i know when the user change/switch the document (not view). The reason is, I would like to update a modless dialog displaying specific info for each document.
Thanks..
|
|
|
|
|
Use a GetActiveDocument() method
Best regards,
Eugene Pustovoyt
|
|
|
|
|
|
I have CWnd and his parent CDialog.
CWnd hides a part of CDialog and a controls included in him.
How can I know what a control under CWnd specifies the mouse pointer?
Best regards,
Eugene Pustovoyt
|
|
|
|
|
WindowFromPoint() or ChildWindowFromPoint() will return the window that contains the mouse cursor. They are slightly different, so look at the docs to see which one you need. Sorry, your specification is a little vague for me to work this out
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
These methods search the child windows, and CWnd is child too, therefore in such a way to find an child element under child will fail.
Similar, that the unique way is to look all child windows, excluding CWnd , for search of a window hided under CWnd
Best regards,
Eugene Pustovoyt
|
|
|
|
|
WindowFromPoint() will find any visible window (child or not) that has the specified point in it. The only restrictions are that the window must be visible and enabled, and it will not return static text windows (it returns the parent of the static text window).
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
CWnd is a child window of the CDialog and the controls are the child window of the CDialog too. But CWnd hides some controls. Therefore control becomes invisible under CWnd and for WindowFromPoint()
Best regards,
Eugene Pustovoyt
|
|
|
|
|
OK. Well in that case use EnumChildWindows() , GetClientRect() and CRect::PtInRect() and check them all manually.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Ok. Thank you
Best regards,
Eugene Pustovoyt
|
|
|
|
|
You're welcome
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
hi,
I am trying to import a tab delimited text file into an MS Access database using transferText function.This transferText function needs the import Specification name for creating the table.It specifies the format ,number of columns ,columnnames etc.We can do it manually in MS Access using import wizard's Advanced button.But in my project requirements are such that the user won't be manually creating the specification.
I ask help of all the experts to help me create the specification programmatically.It's Quite urgent.
Thanks and regards.
|
|
|
|
|
Hi !
I was wondering (and couldn't find any answer in my C++ book) if, when using a struct, it is possible in C++ to do something simliar as :
with MyOwnStruct
.Name="John";
.Age=30;
.Height=180;
Thank you for your help !
Jerome
|
|
|
|
|
Jerome Conus wrote:
possible in C++ to do something simliar as
snip
Short answer: No.
Longer answer:
In C++ you have the concept of encapsulation at hand, why not use it?
class MyOwnClass
{
public:
typedef std::string string;
MyOwnClass(string name, unsigned int age, double height)
: m_name(name), m_age(age), m_height(height)
{
}
private:
string m_name;
unsigned int m_age;
double m_height;
};
|
|
|
|
|
It is a bit twisted but you can do this if you really want to :
class CPerson
{
private:
const char * Name;
int Age;
int Height;
public:
virtual CPerson & SetName(const char *name) { Name = name; return *this; }
virtual CPerson & SetHeight(int height) { Height = height; return *this; }
virtual CPerson & SetAge(int age) { Age = age; return *this; }
};
...
CPerson person;
person.SetName( "Bob" )
.SetAge( 42 )
.SetHeight( 69 );
The Ten Commandments For C Programmers
|
|
|
|
|
Hi,
i have tried changing the the color of the button,using OnCtlColor and many otherways,but it doesn't work..
How to change the color of the button in SDI application?
adieu
ajit
|
|
|
|
|
OnCtlColor havn't effect on the button. You must create owner-draw button to change bk color. Or to use a cool CButtonST class by Davide Calabro.
Best regards,
Eugene Pustovoyt
|
|
|
|
|
can u please send me the link for the CButtonST
|
|
|
|
|
I'm sorry
It's here
Best regards,
Eugene Pustovoyt
|
|
|
|