|
Have you looked at Ed Gadziemski's "Using Blobs with WTL OLE DB Database Applications" on Code Project ( http://www.codeproject.com/wtl/oledb2.asp [^] )? While not specifically geared to VC7, it does address blobs and OLE DB. Perhaps you could adapt it for your needs.
|
|
|
|
|
How to prevent binding a Type library to a ATL Attributed DLL ?
need help
ty
tal halfon
|
|
|
|
|
My ActiveX controls
with property of
IPictureDisp, (Picture hanling -from AtlButton MSDN sample)
take much time for - unload - ,(for 20 controls 5 seconds -
- typical registry time).
All other program waits for this unload - so it is big problem.
How to solve it?
Does there is a method to prevent controls in a dialog to write to registry at destroying of owing them dialog?
I use only C++ property browser,
so can you say: what is unneed interfaces of this control:
<br />
class CAtlButton :<br />
public CTimer<CAtlButton, IAtlButton, &__uuidof(IAtlButton)>,
public CComControl<CAtlButton>,<br />
public CStockPropImpl<CAtlButton, IAtlButton, &__uuidof(IAtlButton), &CAtlModule::m_libid>,<br />
public ISpecifyPropertyPagesImpl<CAtlButton>,<br />
public IPersistStreamInitImpl<CAtlButton>,
public IOleControlImpl<CAtlButton>,<br />
public IOleObjectImpl<CAtlButton>,<br />
public IOleInPlaceActiveObjectImpl<CAtlButton>,<br />
public IViewObjectExImpl<CAtlButton>,<br />
public IOleInPlaceObjectWindowlessImpl<CAtlButton>,<br />
public IPersistPropertyBagImpl<CAtlButton>,
public IPersistStorageImpl<CAtlButton>,
public IQuickActivateImpl<CAtlButton>,<br />
public IDataObjectImpl<CAtlButton>,
public IObjectSafetyImpl<CAtlButton, INTERFACESAFE_FOR_UNTRUSTED_CALLER>
,public IPerPropertyBrowsingImpl <CAtlButton>
thanks you
|
|
|
|
|
I have embed excel into my application and would like to overide my onprint function. Upon entry into this function
pDC->m_hAttribDC; pDC->m_hDC; Are both NULL. the CDC* pDC however is not.
If I try calling onPrint before an excel spreadsheet is open, then neither member is NULL. Only when I have an excel spreadsheet open are these members NULL. Why is this so?
Sincerely,
Mardigin
|
|
|
|
|
Okay I was able to get the hdc in the following manner
<br />
void CBPReportView::OnPrint(CDC* pDC, CPrintInfo* pInfo)<br />
{<br />
<br />
if(pInfo->m_bDocObject)<br />
{<br />
CDC * pOleDC = this->GetDC();<br />
pDC->Attach(pOleDC->m_hDC);<br />
pDC->TextOut(100,100,"Muah ha ha h aa");<br />
COleDocObjectItem::OnPrint(this, pInfo, TRUE);<br />
ReleaseDC(pOleDC);<br />
}<br />
else<br />
CView::OnPrint(pDC, pInfo);<br />
}<br />
Only trouble is that "muah ha ha h aa" never shows up on my printed page, only the excel spreadsheet shows up. Any ideas?
Mardigin
|
|
|
|
|
Greetings people,
I have a strange question here [might not be strange to you *grins*].
I have created an ActiveX Composite control with a combo box in it. I filled the data into the combo box through it's properties->data tab. However, when I test it using the ActiveX Control Test Container or the browser, there is nothing in the combo box.
So, I tried another approach, by using a for loop like this:
char *m_cC[3]={"Cash","Cheque","Credit Card"};
for(int i_P=0;i_P<3;i_P++)
cbControl->AddString(m_cC[i_P]);
The same problem still persists, there is nothing in the combo box. Is there another way to initialize a combo box in ATL technology?
Please advise.
Thank you!
|
|
|
|
|
Hi all.
I have some COM object what contained inside itself another object and i want retrieved this inner object though some method of outer object.
I.e. make like that
HRESULT GetInnerObject(CoInnerObj** ppObj){
* ppObj = m_pInnerObj;//pointer to my inner objetc
return S_OK;
}
May i do this or its unproper way.
I has done my COM object this manner and its work fine, but me suggest don't use this way(and retrieved only interfaces through methods).
I want recognize why??
Also i watch in COM any microsoft applications same way of decision this problem.
Thanks.
|
|
|
|
|
COM is interface-based programming. In general, a thread seens an interface, not a pointer to a coclass. There are numerous possible problems. One problem is compatibility. What you are trying to do is unconventional.
Kuphryn
|
|
|
|
|
The following is a snippet is the code that actually embeds excel into my application and then attempts to remove the insert menuitem. I have read through more then one tutorial, but the most important one to note here is the following: http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q180/6/25.asp&NoWebContent=1
If anyone has anyideas of what is wrong with this code please reply.
Note: The above tutorial instructs to create a dlg based application, Mine is an MDI application. The above tutorial controls excel, my application embeds and then attempts to control excel. It works fine right up until it calles cbPop.SetVisible(FALSE);
Then it falls into the catch:
CException e.m_bAutoDelete = 1
CException e.m_bReadyForDelete = 0
The code I have included here shows how I embed excel and display it on the screen. This is all that i do differently from the above tutorial.
<br />
CBPReportCntrItem *pItem = NULL;<br />
CBPReportDoc *pDoc = NULL;<br />
CLSID clsid;<br />
TRY<br />
{<br />
pDoc = GetDocument();<br />
ASSERT_VALID(pDoc);<br />
<br />
pItem = new CBPReportCntrItem(pDoc);<br />
ASSERT_VALID(pItem);<br />
<br />
if(FAILED(::CLSIDFromProgID(L"Excel.sheet",&clsid)))<br />
{<br />
AfxMessageBox("Failed to create Excel.sheet");<br />
AfxThrowMemoryException();<br />
}<br />
<br />
if(!pItem->CreateNewItem(clsid))<br />
{<br />
AfxMessageBox("Failed to create the excel embeded item");<br />
AfxThrowMemoryException();<br />
}<br />
<br />
ASSERT_VALID(pItem);<br />
<br />
pItem->DoVerb(OLEIVERB_SHOW, this);<br />
<br />
m_pSelection = pItem;
pDoc->UpdateAllViews(NULL);<br />
<br />
lpDisp = pItem->GetIDispatch();<br />
<br />
app.AttachDispatch(lpDisp, TRUE);<br />
<br />
Then further down I did the following
<br />
cbPop.AttachDispatch(app.DetachDispatch(), TRUE);<br />
cbPop.SetVisible(FALSE);<br />
Sincerely,
Mardigin
|
|
|
|
|
There are many thread solutions in ATL but what is the best solution?
I need single thread for background I/O operations.
|
|
|
|
|
Hi
You may see this link http://www.codeproject.com/threads/usinguithreads.asp
|
|
|
|
|
Hi,
does anybody know how to download ActiveX from Apache Server and not from IIS. What should be the HTML Script and where should I put the ActiveX (dll) on Apache Server.
thanks
|
|
|
|
|
Thanks I found the problem
|
|
|
|
|
Hi,
In MFC there is a global function "AfxGetMainWnd" which can retrieve the pointer to the main frame window. However in WTL I did not find anything like that. Does that mean I have to add the pointer manually?
Thanks for your attention.
Lei
|
|
|
|
|
No, there is no built-in main window accessor. You can just add a global CMainFrame* variable, or if you want to be OO, derive a class from CAppModule and add the variable there, with a WtlGetMainWnd() accessor.
--Mike--
"Big handwavy generalizations made from a position of deep ignorance is one of the biggest wastes of time on the net today.
-- Joel Spolsky
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
|
|
|
|
|
If i understand correctly you want to get handle of main frame window??If main frame window present activeX host container thus it support IOleWindow interface and throught one you can get acess to it handle.
Sorry for bad eanglish
|
|
|
|
|
Does WTL work with Windows CE?
|
|
|
|
|
|
Not only is it an old version of WTL, it is probably breaking copyright laws. Does this site have permission to redistribute WTL?
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
I ran across something interesting in VS.NET 2k3. I'm not sure if this is by design or not, so I thought I'd ask here to see if I'm the only one experiencing this issue:
I'm coding an Internet Explorer band control using ATL. I decided to take the plunge and use attributes rather than the traditional class heirarchy. I found that the RGS file is never parsed! Apparently the "module" attribute takes care of the AppID and the "coclass" attribute registers the COM object CLSID.
Here's my dilemma: I need to add some registry settings that enable IE to launch my band control. I have always done this by placing the appropriate code in the RGS file. Now, it appears that I will have to overload the module's "RegisterServer" function in order to accomplish the same thing. Is this true?
Thank you for any light that can be shed on this subject!
--
Paul
"I drank... WHAT?"
|
|
|
|
|
Hello - I need to do some HTML parsing in a service. Does anyone know if the WebBrowser control is safe for this, i.e. doesn't throw up any dialogs? I interested in the DOM methods for parsing the HTML structure out. Anyone have some alternate suggestions for doing this?
Thanks!
Nate
|
|
|
|
|
Don't use the WebBrowser control. It is an ActiveX control and doesn't like to be windowless. Use the MSHTML control, which the browser actually hosts for its HTML parsing and partial rendering. The WebBrowser control handles other display issues, events, and other services.
The MSHTML control is what does the majority of the work and doesn't require a window. It's also lighter and give you access to all the HTML-related things like IHTMLElement , IHTMLDocument2 , etc.
Reminiscent of my younger years...
10 LOAD "SCISSORS"
20 RUN
|
|
|
|
|
Hi ppl, I am new to ATL and trying to add a simple richedit control in a window. But i get "syntax error: missing ';' ..." everytime. Following is my source code.
CMainWindow.h
#ifndef CMainWindow_h
#define CMainWindow_h
#include "stdafx.h"
#include "CNoteEdit.h"
class CMainWindow : public CWindowImpl < CMainWindow >
{
public:
DECLARE_WND_CLASS_EX(TEXT("NoteMainWindowClass"), CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS, COLOR_BTNFACE)
private:
BEGIN_MSG_MAP(CMainWindow)
MESSAGE_HANDLER(WM_CREATE, OnCreate)
MESSAGE_HANDLER(WM_CLOSE, OnClose)
MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
END_MSG_MAP()
LRESULT OnCreate(UINT msg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnClose(UINT msg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnDestroy(UINT msg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
};
#endif
CNoteEdit.h
#ifndef CNoteEdit_h
#define CNoteEdit_h
#include "stdafx.h"
class CNoteEdit : public CWindowImpl < CNoteEdit >
{
public:
DECLARE_WND_SUPERCLASS(NULL, RICHEDIT_CLASS)
BEGIN_MSG_MAP(CNoteEdit)
END_MSG_MAP()
CNoteEdit();
virtual ~CNoteEdit();
};
#endif
main.cpp
#include "stdafx.h"
CComModule _Module;
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
_Module.Init(0, hInstance);
CMainWindow _MainWindow;
_MainWindow.Create(0, CWindow::rcDefault, "Note - ", WS_OVERLAPPEDWINDOW);
_MainWindow.ShowWindow(nShowCmd);
_MainWindow.UpdateWindow();
MSG msg;
while (::GetMessage(&msg,0,0,0) > 0)
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
_Module.Term();
return msg.wParam;
}
In the CMainWindow.cpp, its just code for closing the window and in CNoteEdit.cpp, it has an empty constructor and destructor. Now, if i just remove the CNoteEdit _noteEdit; line from CMainWindow.h then everything is ok (but no richedit ). I know i have to create the CNoteEdit object inside my main window, but i have to get pass the error first ... i think. Plz help me find out the error! Thankx in advance.
-Tareq
|
|
|
|
|
You don't #include stdafx.h in a header file. That should be the first #include in every CPP file, that's it.
--Mike--
"I'm working really, really fast at the moment, so a 3 minute outage becomes, due to time dilation, a 5 minute outage."
-- Chris Maunder, relativistic system administrator
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
|
|
|
|
|
Hi,
I have a dialog that is invoked form a property sheet that has various controls (edit boxes, check boxes) in my dialog. I need to know if the user modified (touched) any of these. There are function handlers for all of the controls (thru the COMMAND_ID_HANDLER macro). I expcted these to be called only when the user changes something. But these functions are being invoked when the dialog shows up!! What is the problem?
Regards
HV
|
|
|
|
|