|
|
Hi,
Can anyone point me towards a good example of using DBProp_ISequentialStream to save BLOBS with the VC7 ATL DB Consumer templates.
The AOTBLOB sample often referred to as the answer to such requests does not appear to work with VC7/JET 4.0 (as compiled straight from the MS archive) and I must confess to not being inclined to track down the specific problem.
Thanks,
Displaced Aussie. Currently in London, normally living in Melbourne.
modified 10-Jul-19 21:02pm.
|
|
|
|
|
The way that I've done this is to implement a C++ object that looks like ISequentialStream, and given the vtable (aka interface) to the provider.
You must provide the status for the column, and some providers may require that you provide the actual length of the blob.
Different providers were 'odd' though; for instance, with SQLServer it fills in the length and status for a blob column (and you need to do likewise when writing), whereas with Oracle's own provider, the length is always 4, which coincidentally is sizeof(void*). Never used Access/JET in this way though.
Displaced eh? I guess that means Melbourne, Australia, rather than Melbourne, Derbyshire.
Steve S
[This signature space available for rent]
|
|
|
|
|
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
|
|
|
|