|
Robert Pickford wrote:
...but it's getting the build number in that is foxing me at the moment.
Isn't that number determined by you?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Yes and no. I use VERSIONINFO and increment the Build number on every major release build so I wanted to automatically put that number into my comments.
|
|
|
|
|
Use a version control package. Then consult the documentation for that package. In CVS you can use
/* $log$
*
*/
to place your change comments in the code, but if you don't use CVS that isn't helpful. There are other things too that you can add, some of which are suitable for assigning to a variable so you can manipulate the version in code.
|
|
|
|
|
When using both modeless dialogs and formviews together in an application, is it an inherent nature of the modeless dialog to always overlap the formview? I know that a possible solution is to pass GetDesktopWindow() as the second parameter in the Create() function for dialogs, but that is not desirable for what I am doing. I want the application's mainframe window to be the parent window. However, when I use this in the Create function, the dialog still covers the formview. Is there any way to prevent my modeless dialogs from hiding my formviews?
Thanks for any suggestions.
|
|
|
|
|
I have problem with an executable with a MFC dialog. Whenever my dialog is up and i switch to MS Word or Paint then close down Word or Paint my exe locks up. It does not seem to repaint or return control when word or paint is shut down.
any suggestions?
|
|
|
|
|
Are you doing anything within OnPaint, KillFocus or SetFocus that could be looping?
I suggest that you:
1) run your application in debug through the IDE.
2) Switch between programs.
3) When you switch back, use the IDE to break into your program.
You should have a better understanding of where it is and what it is doing then.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fuity and sweet. I'm jelly, what am I? - David Williams (Little Britain)
|
|
|
|
|
My dialog(modal) does not get WM_NOTIFY messages.
How can it be fixed?
Thanks.
avivhal
|
|
|
|
|
Hello everyone,
I am updating the code of an already working service. I am trying to start a service on a remote computer from within the main function of the initial service. First I check if the executable of the service is in place and the check fails even if it is there. When I remove this check and try to start it anyway I cannot access the Service Control Manager with the following command:
scmHandle = ::OpenSCManager(serviceComputer, 0, SC_MANAGER_ALL_ACCESS);
It works locally, let's just say for simplicity that I specify as service executable:
\\mypc\c\temp\bla.exe
Is it possible what I am trying to do (by changing permissions in the creation of the initial service or something), or should I forget the whole thing?
Thanks a million in advance
|
|
|
|
|
I have a CDialog.
I'm trying to implement tooltips for the edit controls of the dialog.
I adde the code :
ON_NOTIFY_EX_RANGE(TTN_NEEDTEXT,0,0xFFFF,OnToolTipNotify)
in the message map
and my function is :
BOOL CPageCurrentLoop::OnToolTipNotify( UINT id, NMHDR * pNMHDR, LRESULT * pResult )
The problem is the OnToolTipNotify never gets called. Even if the mouse pointer is over CEdit controls of the dialog.
Thanks.
avivhal
|
|
|
|
|
Has EnableToolTips() been called? You might need to use:
ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTW, 0, 0xFFFF, OnToolTipNotify)
ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTA, 0, 0xFFFF, OnToolTipNotify) Also make sure that no other control (e.g., group box) is obscuring the CEdit controls.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I tried this and it does not help.
I noticed that I dont get any wm_notify messages.
I guess they are "kidnapped" somewhere along the way.. but where?
avivhal
|
|
|
|
|
Aviv Halperin wrote:
I tried this and it does not help.
Meaning that EnableToolTips() has been called and both entries are in the dialog's message map? How are you verifying that OnToolTipNotify() is not getting called?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Yes, EnableToolTips() has been called and both entries are in the dialog's message map.
I tried putting a break point in the message handler in debug mode and never got to the break point.
Then I tried with the spy++ to find out if any notify message is sent and non are sent.
I have complex structure here that might be the reason:
I have a dialog box with a tab control. The tab control has a few pages which are all implemented as child dialogs of the tab control.
I'm trying to add tool tips to some of the controls of the tab pages dialogs.
Thanks.
avivhal
|
|
|
|
|
Did you call EnableToolTips from within your dialog window?
We are men. We are different. We have only one word for soap. We do not own candles. We have never seen anything of any value in a craft shop. We do not own magazines full of photographs of celebrities with their clothes on. - Steve
|
|
|
|
|
hi all
i have a modeless dialog which i call, kind of a waiting dialog if you like
i use
CCPServerWait* m_pWaitDlg;
m_pWaitDlg = new CCPServerWait;
m_pWaitDlg->Create(IDD_DCPSERVER_WAIT
m_pWaitDlg->m_wait_mes = "ConfimingDetails...Please Wait";
m_pWaitDlg->UpdateData(FALSE);
m_pWaitDlg->CenterWindow(CWnd::GetDesktopWindow());
m_pWaitDlg->ShowWindow(SW_SHOW);
m_pWaitDlg->UpdateWindow();
however im getting a debug assertion error on wincore.cpp when i run my program
when i look at the value CCPServerWait has when i step through hWnd is equalling nothing
CCPServerWait {CCPServerWait hWnd=???} CCPServerWait
this used to work fine until i added in the line of code below before the
dialog is called
ok = SQLCreateDataSource(m_hWnd,"CP_CMIS_CON");
which allows the user to create a Datasource
if i take this out the above works, but with it in
it throws me out an error on the m_pWaitDlg->UpdateData(FALSE); line
i assume this is because hWnd=???
but i dont know how to fix it
any ideas ????
|
|
|
|
|
You're calling UpdateData() but the controls do not exist yet. Remove that call altogether. Then in the dialog's OnInitDialog() method, use SetWindowText() instead. The CenterWindow() call should be moved to the dialog's OnInitDialog() method.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
thanks
when i call the dialog though, i pass some kind of text to it but thats different
each time i call the dialog
i was using
m_pWaitDlg->m_wait_mes = "Confiming School Details...Please Wait";
how do i do it now ?
thanks
si
|
|
|
|
|
si_69 wrote:
i was using
m_pWaitDlg->m_wait_mes = "Confiming School Details...Please Wait";
how do i do it now ?
No change. m_wait_mes should be a CString object. The dialog should also have a CEdit object, whose SetWindowText() method will get called with m_wait_mes as the parameter.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hello everybody,
I am a beginner in com programming, and i have a question:
I have created an ATL 3.0 project including a simple object named MyObj with the attribute of 'appobject' on it's coclass. It has a property named MyString that holds string values. I have successfully built it and then tested it from vb. I have access to MyString property directly without instantiating MyObj. everythings is Ok.
but I have problem with VC. From a Console application which has access to that type library (via import directive) MyString property cannot be accessed without qualification. With the statement:
MyString = "Hello world!";
compiler generates following error:
error C2065: 'MyString' : undeclared identifier
what is the problem? do you think i should use a special syntax?
if so, would you please help me to know how i can use it?
thanks in advance
Roozbeh
|
|
|
|
|
I call the function 'Navigate2' of IWebBrowser2 interface as following:
_variant_t varURL(_bstr_t("www.codeproject.com"));
_variant_t varMyHeaders(_bstr_t("Cookie: JSESSIONID=0000Fkdkdaourejlasdfa"));
_variant_t varFlags((short)navOpenInNewWindow);
_variant_t varTargetFrameName(_bstr_t("_BLANK"));
_variant_t varEmpty;
m_pWebBrowser->Navigate2(
&varURL,
&varFlags,
&varTargetFrameName,
&varEmpty,
&varMyHeaders);
But the content of varMyHeaders is not added to the default Microsoft Internet Explorer headers. I don't know what the problem is.
Is there anybody who met similar problems? Any suggestion will be appreciated. Thanks very much.
|
|
|
|
|
I think the problem is that the headers are a byte array rather then a unicode string.
This is from MSDN.
The post data specified by PostData is passed as a SAFEARRAY Data Type structure. The variant should be of type VT_ARRAY and point to a SAFEARRAY Data Type. The SAFEARRAY Data Type should be of element type VT_UI1, dimension one, and have an element count equal to the number of bytes of post data.
If you don't kill me you will only make me stronger
That and a cup of coffee will get you 2 cups of coffee
|
|
|
|
|
Hi,
In your example you use www.codeproject.com, in your real application do you use "http://www.yoururl.com" ?
Only here is an exert from MSDN (I've bolded the relevant part):
------------------
Headers
[in] Pointer to a value that contains the HTTP headers to send to the server. These headers are added to the default Microsoft Internet Explorer headers. The headers can specify things such as the action required of the server, the type of data being passed to the server, or a status code. This parameter is ignored if a URL is not an HTTP URL.
I've used the following in a previous app. and it added the headers fine:
strURL = "http://server1/CustomApp/validate.asp";
COleVariant vtEmpty;
long lFlags = 4;
m_ctlWeb1.Navigate2(COleVariant(strURL),
COleVariant(lFlags, VT_I4),
COleVariant("_self"),
&vtEmpty,
COleVariant("CUSTOM:1\r\fXYZXYZ:1234\r\f"));
Hope this helps,
Andy
|
|
|
|
|
Hi!
I have an object which I need to check regularly. I want the following:
1. a member storing when the object was last checked
2. a member storing the length of time between checks
This is for when I run my program if I check the current time vs the last checked time and then determine if the length of time between checks has been exceeded I can then perform an update.
My question is what should I use to store these members? Should I use a SYSTEMTIME structure or is there a better method? Can I compare SYSTEMTIME with the current time and do operations like subtract to find if the length of time between checks is exceeded?
Are there any problems with using SYSTEMTIME?
|
|
|
|
|
Something like:
class CMyObject
{
public:
void Check( void )
{
m_timeLastChecked = COleDateTime::GetCurrentTime();
}
void GetCheckAge( COleDateTimeSpan &timeAge )
{
timeAge = COleDateTime::GetCurrentTime() - m_timeLastChecked;
}
private:
COleDateTime m_timeLastChecked;
};
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Thanks
I have never used that class before. Is there any particular reason why to use it instead of SYSTEMTIME or CTime? Looking at it I may also use COleDateTimeSpan to store the time between checks.
|
|
|
|