|
Yup....the solution is...
LRESULT CKnob::OnShowWindow(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)
Thats where the window is already created and ready. Needed to overide that and add my code inside there.
Thanks!
|
|
|
|
|
In virtula method FinalConstruct() is control created in sense of com object. Creation of control (window) is performed in method OnCreate(...) (this is message handler of message WM_CREATE like in common window).
|
|
|
|
|
hi,
i got an add-in that creates new .cpp and .h file with templates in them.
i want that after i save the files in the project to get them into the VSS.
how can i do that?
(EnvDTE.SourceControl only got checkout functions...)
Avi.
|
|
|
|
|
|
thanks man,
but i didn't find there an answer to my question...
can u direct me further more?
|
|
|
|
|
How can i move the bottom element in an array to the top,
From
Name 1
Name 2
Name 3
to
Name 3
Name 1
Name 2
can anyone help
|
|
|
|
|
I am writing an add-in for Visual Studio .NET 2003 on Windows XP SP2 that will display a dialog with a list control. However when I build the solution, I get 4 linker errors saying that some functions e.g. SetItemColor cannot be found. I have included the path to the WTL files in the properties section of the solution.
Anybody with an answer?
I am the handsome one in the crowd.
|
|
|
|
|
I have an ATl ActiveX control I am writing which has support for MFC. I want to add a CEdit in my control so that the user can enter values. How do I create this?
I have spent all yesterday (literraly) trying and no luck.
I construct by
CEdit myEdit;
Followed by
CWnd* parent = CWnd::FromHandle(this->m_hWnd);
myEdit.Create(ES_CENTER | ES_NUMBER | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER,
CRect(10, 10, 100, 40), parent, 1);
This causes assertion...I cannot even find or understnad where the assertion is caused as when i look at the call stack in the debugger, there are no comments or ASSERT(...) around.
Has anybody sucessfully added a CEdit to an ATL ActiveX control which supports MFC? If so...how?
Thanks
|
|
|
|
|
Well...finally got this one figured out.
Must add [code]AFX_MANAGE_STATE(AfxGetStaticModuleState());[/code] before [code]CWnd* parent = CWnd::FromHandle(this->m_hWnd);
myEdit.Create(ES_CENTER | ES_NUMBER | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER,
CRect(10, 10, 100, 40), parent, 1);[/code]
Ciao
|
|
|
|
|
Sorry,I tried this,but still can't work,IE crashed and error is "Debug Assertion Failed"
|
|
|
|
|
Can any one tell me how to check EOF/BOF status in a rowset?
Lisoft
|
|
|
|
|
Hey i had the same problem. Well there is no EOF or BOF.
Check for S_OK as till S_OK is returned EOF is not reached.
i solved it using that.
Gaurav Jain
K.K. Wagh Institue of Engineering Education and Research,
Nashik,
Maharashtra,
India.
gauravjain911@yahoo.com
|
|
|
|
|
I also found the OLE DB consumer templates does not have the EOF/BOF status like the ODBC(MFC) class which I used to access the database before. When CRowset class was first initialized by CCommand::Open method, the 'cursor' does not point to the first record like the ODBC(MFC) class. The only way to check if there is anything returned from the database is to call CRowset::MoveNext() method and check the return value to determine EOF status.
Anyway, thanks for your help.
Lisoft
|
|
|
|
|
Hallo,
I need please help to pass string from a dll to an nt service.
I’m also interesting in a way to pass string from a service (c++) to a vb application that not runs a form.
Thanks a lot for helping
dabayi
|
|
|
|
|
I am trying to write a application with string dialog resources in 2 languages(En and De). SetThreadLocale works fine in XP system, but not in 98.
How should i do to load and display an De dialog on 98 system
|
|
|
|
|
At me such problem:
When the standard page of properties (Property Page) is created - that everything is all right,
And when I try to create it manually - it is not displayed.
I hands finish such in CoClass.h:
BEGIN_PROP_MAP (COpenGL)<br />
PROP_DATA_ENTRY ("_cx", m_sizeExtent.cx, VT_UI4)<br />
PROP_DATA_ENTRY ("_cy", m_sizeExtent.cy, VT_UI4)<br />
PROP_ENTRY ("FillColor", DISPID_FILLCOLOR, CLSID_StockColorPage)<br />
<br />
PROP_ENTRY ("Dialog", 2, CLSID_PropDlg)
<br />
END_PROP_MAP ()
And in a result the Property Page created in manual is not displayed (and that standard "FillColor" - is displayed)......... (are displayed only standard - FillColor, and one more)
What to make, that it worked?
And all over again I received the message, that CLSID_PropDlg is in general a unknown piece (but then itself has passed)
That I receive in a idl-file:
import "E:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\include\prsht.idl";
import "E:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\include\mshtml.idl";
import "e:\program files\microsoft visual studio .net 2003\vc7\platformsdk\include\dimm.idl";
import "E:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\include\mshtmhst.idl";
import "e:\program files\microsoft visual studio .net 2003\vc7\platformsdk\include\docobj.idl";
import "E:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\include\exdisp.idl";
import "E:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\include\objsafe.idl";
[
object,
uuid(BB2EEEBB-B474-4CBC-9B70-697E4ECC1EE8),
dual,
helpstring("IOpenGL Interface"),
pointer_default(unique)
]
#line 49 "d:\\d\\c7\\com\\atlgl\\atlgl\\opengl.h"
interface IOpenGL : IDispatch {
#line 52 "d:\\d\\c7\\com\\atlgl\\atlgl\\opengl.h"
[propput,bindable,requestedit,id((-510))] HRESULT FillColor([in] OLE_COLOR clr);
#line 54 "d:\\d\\c7\\com\\atlgl\\atlgl\\opengl.h"
[propget,bindable,requestedit,id((-510))] HRESULT FillColor([out,retval] OLE_COLOR *pclr);
[id(1),helpstring("method GetLightParams")] HRESULT GetLightParams([out] int *pPos);
[id(2),helpstring("method SetLightParam")] HRESULT SetLightParam([in] short lp, [in] int nPos);
[id(3),helpstring("method ReadData")] HRESULT ReadData();
[id(4),helpstring("method GetFillMode")] HRESULT GetFillMode([out] DWORD *pMode);
[id(5),helpstring("method SetFillMode")] HRESULT SetFillMode([in] DWORD *nMode);
[id(6),helpstring("method GetQuad")] HRESULT GetQuad([out] BOOL *bQuad);
[id(7),helpstring("method SetQuad")] HRESULT SetQuad([in] BOOL bQuad);
};
[ version(1.0), uuid(4CA16C3B-D4B6-434D-9648-2E419FF79F15), helpstring("ATLGL 1.0 Type Library") ]
library ATLGL
{
importlib("stdole2.tlb");
importlib("olepro32.dll");
[
uuid(9D2FB6B9-6797-45D0-A331-A6DE808F9A82),
helpstring("_IOpenGLEvents Interface")
]
#line 72 "d:\\d\\c7\\com\\atlgl\\atlgl\\opengl.h"
dispinterface _IOpenGLEvents {
properties:
methods:
};
[
version(1.0),
uuid(35435006-DA95-4B34-9988-5A0A512E3F3C),
helpstring("OpenGL Class")
]
#line 88 "d:\\d\\c7\\com\\atlgl\\atlgl\\opengl.h"
coclass COpenGL {
interface IOpenGL;
[default, source] interface _IOpenGLEvents;
};
[
version(1.0),
uuid(F2FBEB23-A2C0-4C9D-B049-6E14D8A3E8CF),
helpstring("PropDlg Class")
]
#line 19 "d:\\d\\c7\\com\\atlgl\\atlgl\\propdlg.h"
coclass CPropDlg {
[default] interface IUnknown;
};
[
version(1.0),
uuid(CD2867E6-F4C7-48A6-8D06-D1856D501B2E),
helpstring("tMy Class")
]
#line 19 "d:\\d\\c7\\com\\edf\\atlgl\\tmy.h"
coclass CtMy {
[default] interface IUnknown;
};
}
|
|
|
|
|
Do not pay attention to this post, I have already found a mistake
|
|
|
|
|
Hi,
if I use e.g.
CComPtr<imy> pMy;
...
pMy->Advise(...)
who calls the UnAdvise? Or is it enough if the pMy is released? Cause I think if no one calls the UnAdvise the server doesn't know that the sink will not exist any more!?
thx&greets
|
|
|
|
|
I guess you have to. See MSDN for AtlAdvise and AtlUnadvise docs.
AFAIK the server holds a reference to the sink until the Unadvise is called - so even if you release pMy, the object will still remain with refcount == 1
(but it's long time I did something with com events, so I might be easily wrong)
|
|
|
|
|
I am creating a static control and trying to change the font being used. Right now I am doing this:
<br />
m_TextWindow.SetFont(static_cast<HFONT>(GetStockObject(DEFAULT_GUI_FONT)));<br />
How would I create a new font and set it?
|
|
|
|
|
Nevermind all. I figured it out. I just create a variable of type HFONT, then use the CreateFont method to create a font. and then set the font:
<br />
HFONT hFont = CreateFont (8,0,0,0,FW_LIGHT, 0, 0, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS,<br />
CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, "Tahoma");<br />
<br />
m_TextWindow.SetFont(hFont);<br />
|
|
|
|
|
Tell me it look like this MFC question and you have posted it in worng Forum.
any way if it MFC you can use CFont and it member function i.e. (CreateFont) to create your own font.
or you can directly use Win32Api function CreateFont to create your own font and set in the static Ctrl.
here is small code listing for your problem
CFont fnt;
fnt.CreateFont(12,0,0,0,FW_BOLD,FALSE,FALSE,FALSE,
DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,
DEFAULT_PITCH ,"Arial");
m_TextWindow.SetFont(&fnt);
"I Think this Will Help"
<h5
alok="" gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
ThatsAlok wrote:
Tell me it look like this MFC question and you have posted it in worng Forum.
No, it was not MFC code. It was straight ATL.
--
My name in Katakana is ヨルゲン.
My name in German is Jörgen.
I blog too now[^]
|
|
|
|
|
Window Api so vast, That it can be use in any thing from Old Win32 api based project to new ATL/COm Project, Dunno know abt Visual C++.net
that why, it's some time confused programmer,that in which project he/she is programming.
"I Think this Will Help"
<h5
alok="" gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
hi,
I am looking for articles / sites to learn ATL and COM. Could you please help me. I am a beginner in using MFC.
thanks,
suri
|
|
|
|
|