|
Hi John,
thanks for that,
im a bit confussed on how u have declare m_pConnection
in the header file
thanks in advance
si
|
|
|
|
|
si_69 wrote:
im a bit confussed on how u have declare m_pConnection
That was an example I took from another site. Just use cpDb instead.
John
|
|
|
|
|
John M. Drescher wrote:
That was an example I took from another site. Just use cpDb instead.
hi john
i have the following code now, but im getting an undeclared
identifier on m_pConnection. i know i have to declare
this but as what ? help as u have probably gathered my c++ is pants
thanks
simon
_ConnectionPtr cpDb; // is declared in my header file
cpDb = m_pConnection ;
basic_stringstream strSQLStatement;
variant_t vntRecordAffected;
strSQLStatement <<l"insert into="" new_call_message(school_id,unique_number,custom,type)="" values(4055,77866,1,'customeee')="" ";
bstr_t="" strsqlstmt="strSQLStatement.str().c_str();
try
{
cpDb-">Execute(strSQLstmt, &vntRecordAffected, adCmdText );
}
catch(_com_error &e)
{
GenerateError(e.Error(), e.Description());
}
|
|
|
|
|
Remove the following line:
cpDb = m_pConnection ;
m_pConnection was a _ConnectionPtr declared in their header file.
John
|
|
|
|
|
I've read some articles about how to write Explorer Bars. They are interesting, but if the bar cannot exchange with other parts of the Explorer, it is hardly of any use, I think.
For example, I want my bar to catch the events when user has selected files in explorer's right pane, then show some information and display common tasks which can be performed on such files. But how can I? None of the articles told me. I also want that the right pane can navigate to special folder I prefered.
I know that there is an IShellView::SelectItem method, but I don't know how can I hook into it. Or should I go another way?
|
|
|
|
|
Read Shell Programming by Mike Dunn, that's the beginning of your answer.
~RaGE();
|
|
|
|
|
I have read these ones, since they are knowleages that I should master. but I could not find exactly what I want
|
|
|
|
|
Hi,
My VC6 plugin needs to output some text to the build pane. Is this possible?(IApplication.PrintToOutputWindow only goes to a macro-specific page).
TIA
Peter
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
MDI with multiple views and one document
I have an MDI application with one document and one view.
I would like to create multiple instances from the same document class whereas any documents have the one view and any documents have the other view.
So i have made several View-classes and have created several document templates with the following code:
<br />
CMultiDocTemplate* pDocTemplate;<br />
pDocTemplate = new CMultiDocTemplate(<br />
IDR_MDITYPE,<br />
RUNTIME_CLASS(CMDIDoc),<br />
RUNTIME_CLASS(CChildFrame), <br />
RUNTIME_CLASS(MDIView ));<br />
AddDocTemplate(pDocTemplate);<br />
<br />
pDocTemplate = new CMultiDocTemplate(<br />
IDR_MDITYPE,<br />
RUNTIME_CLASS(CMDIDoc),<br />
RUNTIME_CLASS(CChildFrame) <br />
RUNTIME_CLASS(CMDIView2));<br />
AddDocTemplate(pDocTemplate);<br />
The difference between the doc templates are only the View-classes.
When i choose the open-file command from the file menu, the icon for the file-type is not the icon defined by IDR_MDITYPE but the icon with the next greater ID. (also at Explorer)
I have solved this problem by creating a icon which looks like the IDR_MDITYPE icon and which has the next greater ID. But this solution seems me to tricky. Does anybody know another one?
Thanks
Andy
|
|
|
|
|
I have a dialog box with a property sheet and 2 property pages. In my property page I have a button. When I push this button, I want to show a dialof. But the call to CreateDialogIndirect during the domodal doesn't return and my app is blocked. Any ideas ?
|
|
|
|
|
CHAIGNEAU wrote:
doesn't return
What do you mean ? Is the dialog box displayed ? How do you dismiss it ? Or does your program hang when doing the CreateDialogIndirect ? If yes, is it working if you use DoModal() isntead of starting it with CreateDialogIndirect() ?
~RaGE();
|
|
|
|
|
If your app hangs, maybe you have forgotten to use ShowWindow(SW_SHOW); to show your dialog, since this is not automatically done by the CreateDialogIndirect() function.
~RaGE();
|
|
|
|
|
I instantiate a dialog and then call domodal.
Domodal call CreateDialogIndirect() and my program hang.
I have found the reason : I must modify the ex style of my propertysheet to put WS_EX_CONTROLPARENT.
I have found in the MSDN an article wich describe this problem.
Thanx to all.
|
|
|
|
|
I have a problem using COXSizeControlBar from Dundas Ultimate Toolbox 7.5. I have a COX3DTabViewContainer object inside a class derived from COXSizeControlBar. The tab control has two tabs and in one tab there is a COXShorcutBar object, in the other tab there is a CTreeControl object. The problem is that when I use message handlers inside the class derived from COXSizeControlBar, the message handler gets called and processed but when the message returns to the control that originated the message (e.g. the tree control) the return value is always 0 (the value pointed by the LRESULT parameter of the message handler) even if I change the value in the message handler. It is not possible for me then to cancel the editing of a tree control item label (for instance). Have anybody found this problem yet? I have modified and example from Dundas which exactly does this and IT DOES NOT WORK? I guess it is a problem either with the message routing of the COXSizeControlBar or the COX3DTabViewContainer but I haven't been able to find it yet?
Thanks in advance,
Miguel
|
|
|
|
|
Miguel,
Can you send me the sample you created to reproduce this problem? I will try to fix it and send you the updated ToolBox files.
Ivor S. Sargoytchev
Dundas Software
|
|
|
|
|
Miguel,
The problem that you encountered is not in Ultimate ToolBox's COXSizeControlBar, but it is in the way MFC handles notify messages in grand parent windows. If you construct a small dialog based application that has a tab control and you add a tree as a child window of the tab control, you will find the same problem - handling TVN_BEGINLABELEDIT in the dialog and returning TRUE will not prevent a label from being edited.
The solution to this problem if to handle the TVN_BEGINLABELEDIT either in a derived class or a parent window class - but not in a grand parent.
Ivor S. Sargoytchev
Dundas Software
|
|
|
|
|
Igor,
I think I do not understand what you say in your mail. In the Dundas example I sent you, there are the following window classes:
CMainFrame ----> grandparent of CTreeCtrl data member
C3DTabViewBar----> parent of CTreeCtrl data member
CTreeCtrl ----> child
In your mail you say the TVN_BEGINLABELEDIT message should be handled either in a derived class (of CTreeCtrl I guess you mean) or in the parent window class (C3DTabViewBar which is derived from COXSizeControlBar). Well, in the example I sent you the TVN_BEGINLABELEDIT message handler is placed in the parent window (the C3DTabViewBar) and the message in not handled properly (as you can see in the example I sent you). As you say if you try to handle the message in the grand parent window (CMainFrame) it also doesn´t work (which I tried before).
From your mail, i guess you have another example that does not work but, do you please have an example that works with the COXSizeControlBar? I need to solve this problem and it will save a lot of time to me if you already have a solution for this.
¿Can you clarify to me what you say in your mail? If I understand right, the example I sent you should work and it doesn´t. I also tried to handle the message in CMainFrame and it also does not work.
Best Regards and thanks for the help,
Miguel
|
|
|
|
|
Miguel,
In the example that you sent me the member m_treeClass of type CTreeCtrl if a child of m_TabViewContainer of type COX3DTabViewContainer which is a child of m_3DTabViewBar of type C3DTabViewBar.
Therefore m_3DTabViewBar is a grand parent of m_treeClass and you are handling your TVN_BEGINLABELEDIT message in C3DTabViewBar.
Just make m_treeClass a child of m_3DTabViewBar and you will see - the message is handled properly.
Ivor S. Sargoytchev
Dundas Software
|
|
|
|
|
Dear Ivor,
First of all I apologize for calling you Igor in my first message (it is a more common name to me). Secondly, I manage to get the application working with the tips you gave me. Nevertheless, I still do not fully understand how the thing is working. In my application I set the parent of the tree ctrl to the COXSizeControlBar class (m_wndTree.Create(pParentWnd... where pParentWnd is a pointer to an object of a class derived from COXSizeControlBar). After this I created the tab control as a child of the COXSizeControlBar class and added the tree control to a page of the tab control. Then it was possible to handle messages from the tree control inside the COXSizeControlBar derived class.
This happens even if AddPage from the Dundas tab control makes m_wndTree.SetParent(this) where 'this' is the tab control !!!!!!!!
So in fact, I am handling messages inside the grandparent window class (The COXSizeControlBar. I have also a COXShortcutBar inside the tab control and for this I made the same thing than with the tree control. I passed a pointer to the COXSizeControlBar in the create method of the shortcut bar and then added it to a page of the tab control (COX3DTabViewBar). As you know, AddPage() sets to 'this' the parent window of control passed as argument of the AddPage() method. In this case, I was not able to process messages inside the COXSizeControlBar. I found out that it is because COXSizeControlBar 'only' sends messages to its parent/owner window so it is only possible to process them there.
What is surprising to me is that I am able to process messages inside the grandparent window event if the Dundas code makes SetParent() to 'this' for the tree control inside the AddPage method of the tab control.
I also tried to handle the messages inside a CTreeControl derived class and also it does not work. This means, I cannot handle messages inside a control's derived class which very annoying. I do not know if this is an MFC problem because I do not know what is going on.
Any ideas of what is behind this behaviour?
Best Regards,
Miguel
|
|
|
|
|
Hi Miguel,
The tree control (SysTreeView32) like all common controls sends the TVN_BEGINLABELEDIT notification thought WM_NOTIFY to its parent. The problem is that the parent to which the notification messages are sent is set at creation time (when ::CreateEx(...) for the tree is called) and cannot be changed later on. You can call SetParent(...) later on until you are blue in the face, but the messages will still be sent to the original parent. This is a problem with SysTreeView32 common control. You can easily reproduce it with a simple dialog based application where you have a tree control as a child of a tab control.
The problem second problem - namely not being able to handle TVN_BEGINLABELEDIT in derived classes is a direct consequence of the problem that I just described. This is so because handling notification messages in derived classes relies on the parent window to reflect the message back to the child control.
Ivor S. Sargoytchev
Dundas Software
|
|
|
|
|
Thanks for the info and for solving my problem. I could not read it until today.
Best Regards,
Miguel
|
|
|
|
|
Hi, all
In windows if we right click any file we get a popup menu which contains something like "undo, cut, copy....etc"
My question is suppose I am doing a project where my file extention is .har.
now When a user right clicks the .har files I want to add one extra menu item.
Hope I gave clear idea about my question.
Any help will be of good use to me
thanks
harinath
Harinath Reddy
HOneywell Technology Solutions Lab,
Bangalore,
India-560076
harinath@vandemataram.com
|
|
|
|
|
As far as I know, that has to do with shell programming. Look at Mike Dunn's awesome articles about shell programming here on CP.
A short explanation :
Your file extension has an entry in the registry uder HKEY_CLASSES_ROOT\.har, and the associated value is your file names, like "Harinath Files".
Then, under HKEY_CLASSES_ROOT\Harinath Files\shell\command\open, you have your application path, this meaning that the shell conmand "open" will launch the appliaction associated to .har files.
Now if you add some other commands, then they will be showed in the menu.
Check the articles I meant, and you'll see.
~RaGE();
|
|
|
|
|
|
Thank you buddy.
I am reading the article.
Thanks a lot.
cheers
harinath
Harinath Reddy
HOneywell Technology Solutions Lab,
Bangalore,
India-560076
harinath@vandemataram.com
|
|
|
|