|
|
hi, was trying to add a function [view image in new window], right above the line of save image of IE's right click context menu.
with referencing to msdn article titled "Adding Entries to the Standard Context Menu(Internet Explorer - Browser Extensions )" , i start to edit my windows registry. After adding a key named "view image in new window", and change it's value to the processing page, i later on try to add a binary value under it, with value 0x2 which only display this options when users click on an image only, but when i try to modify this binary value's value, it pop up a windows which show 4 0's as 0000, once i typed 0, it display another 2 0's, anyone hv any ideas on how this can be??
beside that, i also cant find more details on how the processing page will be, which i just like to get the image's path(preferable path which link to the image file in cache) , and display it in a new window....
hope can get some help or recommendation to some useful articles ...
thx in advance
|
|
|
|
|
add-on : link to the article titled "Adding Entries to the Standard Context Menu(Internet Explorer - Browser Extensions )", as mentioned above
http://msdn.microsoft.com/workshop/browser/ext/tutorials/context.asp
|
|
|
|
|
hi!!
im trying to create a Schema rowset as i want to display the tables existing in the database.
but im geting a Windows Error Report as soon as i execute getrowset function. Im building a COM using ATL.
any help is welcome.
STDMETHODIMP Cfuctcont::pop()
{
// TODO: Add your implementation code here
DBPROP InitProperties[5], InitProperty[3];
DBPROPSET rgInitPropSet;
IDataInitialize * pDataInit = NULL;
IDBInitialize * pDataSourceIDBInitialize = NULL;
IDBCreateSession * pSession = NULL;
IDBProperties * pProperties = NULL;
IDBCreateCommand * pCreateCommand = NULL;
ICommand * pCommand = NULL;
ICommandProperties * pCommandProperties = NULL;
ICommandText * pCommandText = NULL;
IOpenRowset * pOpenRowset = NULL;
IRowset * pRowset = NULL;
IRowsetChange * pRowsetChange = NULL;
IDBSchemaRowset * pSchemaRowset =NULL;
WCHAR wszProvider[] = L"MSDASQL"; // The Provider string
CLSID clsid;
HRESULT hr= S_OK;
// Init OLE and set up the data
CoInitialize(NULL);
// Setting up all the properties
// a) Setting up the Intitialization properties
for(long i=0;i<5; i++)
{
InitProperties[i].dwOptions = DBPROPOPTIONS_REQUIRED;
InitProperties[i].colid = DB_NULLID;
InitProperties[i].dwStatus = DBPROPSTATUS_OK;
}
// Data source string.
InitProperties[1].dwPropertyID = DBPROP_INIT_DATASOURCE;
InitProperties[1].colid = DB_NULLID;
InitProperties[1].vValue.vt = VT_BSTR;
InitProperties[1].vValue.bstrVal = SysAllocString(L"user");
InitProperties[4].dwPropertyID = DBPROP_INIT_OLEDBSERVICES;
InitProperties[4].vValue.vt = VT_I4;
InitProperties[4].vValue.lVal = DBPROPVAL_OS_ENABLEALL;
rgInitPropSet.guidPropertySet = DBPROPSET_DBINIT; // the property set
rgInitPropSet.cProperties = 5; // # of properties being set
rgInitPropSet.rgProperties = InitProperties; // array of DBPROP structures
// b) The Rowset properties
InitProperty[0].dwPropertyID = DBPROP_CANFETCHBACKWARDS;
InitProperty[1].dwPropertyID = DBPROP_IRowsetLocate;
for(i=0;i<2; i++)
{
InitProperty[i].dwOptions = DBPROPOPTIONS_REQUIRED;
InitProperty[i].colid = DB_NULLID;
InitProperty[i].dwStatus = DBPROPSTATUS_OK;
}
// 1. Data Source Initialization
hr = CoCreateInstance(CLSID_MSDAINITIALIZE, NULL, CLSCTX_INPROC_SERVER, IID_IDataInitialize, (void**)&pDataInit);
// Creating the IDBInitialize
hr = CLSIDFromProgID(wszProvider, &clsid);
hr = pDataInit->CreateDBInstance(clsid, NULL, CLSCTX_INPROC_SERVER, NULL, IID_IDBInitialize, (IUnknown**) &pDataSourceIDBInitialize);
// Setting the Initialization properties
hr = pDataSourceIDBInitialize->QueryInterface(IID_IDBProperties, (void**)&pProperties);
hr = pProperties->SetProperties(1,&rgInitPropSet);
hr = pDataSourceIDBInitialize->Initialize( );
hr = pDataInit->Release();
hr = pProperties->Release();
//session creation
hr = pDataSourceIDBInitialize->QueryInterface(IID_IDBCreateSession, (void**)&pSession);
hr = pDataSourceIDBInitialize->Release();
IUnknown *pUnkSession =NULL;
hr = pSession->CreateSession(NULL, IID_IOpenRowset, &pUnkSession);
IDBSchemaRowset * pIDBSchemaRowset = NULL;
// pUnkSession->QueryInterface(IID_IDBSchemaRowset, (void**)&pIDBSchemaRowset);
pSession->Release();
IUnknown * pUnkCommand = NULL;
IOpenRowset * pIOpenRowset = NULL;
WCHAR wszTableName[11] = {0};
DBID TableID;
IUnknown *ppUnkRowset;
IUnknown *ppRowset;
VARIANT rest[]={VT_EMPTY,VT_EMPTY,VT_EMPTY,VT_EMPTY};
::MessageBox(NULL,"Helooo",NULL,MB_OK);
const ULONG cProperties = 2;
DBPROP rgProperties[cProperties];
DBPROPSET rgPropSets[1];
// rgPropSets, cProperties, rgProperties);
//DBPROPSET* pPropSet, ULONG cProperties, DBPROP* rgProperties)
rgPropSets->rgProperties = rgProperties;
rgPropSets->cProperties = cProperties;
rgPropSets->guidPropertySet = DBPROPSET_ROWSET;
rgProperties[0].dwPropertyID = DBPROP_CANFETCHBACKWARDS;
rgProperties[1].dwPropertyID = DBPROP_IRowsetLocate;
for(i=0;i<2; i++)
{
rgProperties[i].dwOptions = DBPROPOPTIONS_REQUIRED;
rgProperties[i].colid = DB_NULLID;
rgProperties[i].dwStatus = DBPROPSTATUS_OK;
}
hr = pSchemaRowset->GetRowset (
NULL,
DBSCHEMA_TABLES,
0,
NULL,
IID_IRowset,
1,
rgPropSets,
&ppRowset);
if(hr==S_OK)
::MessageBox(NULL,"ok",NULL,MB_OK);
if(hr==DB_S_ERRORSOCCURRED )
::MessageBox(NULL,"HI",NULL,MB_OK);
if(hr==DB_S_ASYNCHRONOUS)
::MessageBox(NULL,"HI1",NULL,MB_OK);
//if(hr==DB_S_NOTSINGLETON )
//::MessageBox(NULL,"HI2",NULL,MB_OK);
if(hr==E_FAIL )
::MessageBox(NULL,"HI3",NULL,MB_OK);
if(hr==E_INVALIDARG )
::MessageBox(NULL,"HI4",NULL,MB_OK);
if(hr==E_NOINTERFACE )
::MessageBox(NULL,"HI5",NULL,MB_OK);
if(hr==DB_E_ABORTLIMITREACHED)
::MessageBox(NULL,"HI6",NULL,MB_OK);
if(hr==DB_E_ERRORSOCCURRED)
::MessageBox(NULL,"HI7",NULL,MB_OK);
if(hr==DB_E_NOAGGREGATION)
::MessageBox(NULL,"HI8",NULL,MB_OK);
if(hr==DB_E_NOTFOUND )
::MessageBox(NULL,"HI9",NULL,MB_OK);
if(hr==DB_E_NOTSUPPORTED)
::MessageBox(NULL,"HI10",NULL,MB_OK);
if(hr==DB_SEC_E_PERMISSIONDENIED)
::MessageBox(NULL,"HI11",NULL,MB_OK);
if(hr==DB_E_OBJECTOPEN )
::MessageBox(NULL,"HI12",NULL,MB_OK);
if(hr==E_OUTOFMEMORY )
::MessageBox(NULL,"HI13",NULL,MB_OK);
::MessageBox(NULL,"HIsfsf",NULL,MB_OK);
return S_OK;
}
thanking you.
Gaurav Jain
K.K. Wagh Institue of Engineering Education and Research,
Nashik,
Maharashtra,
India.
gauravjain911@yahoo.com
|
|
|
|
|
I used win32 application and wrote one WTL application file it shows error "WTL requires IE version 3.0 or higher" at compile time.
|
|
|
|
|
You need to set the macro '_WIN32_IE' to match the minimum version of Internet Explorer you're willing to support (this is basically for Common Controls support).
So, for IE3, put
#define _WIN32_IE 0x0300
in your stdafx.h, or for IE6, put
#define _WIN32_IE 0x0600
Note that there are also macros to set the OS level - see this page[^] for more details.
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
I inserted #define _WIN32_IE 0x0600 after compiling i got 6 error messages
First message "missing ';' before identifier 'lpnm'"
what i should do
|
|
|
|
|
I think you'll have to define WINVER and _WIN32_WINNT as well.
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
thank you for your reply
I used two header file and one cpp file. The files are following
// stdafx.h
#define STRICT
#define WIN32_LEAN_AND_MEAN
#define _WTL_USE_CSTRING
#define _WIN32_IE 0x0600
#include <atlbase.h> // base ATL classes
#include <atlapp.h> // base WTL classes
extern CAppModule _Module; // WTL version of CComModule
#include <atlwin.h> // ATL GUI classes
#include <atlframe.h> // WTL frame window classes
#include <atlmisc.h> // WTL utility classes like CString
#include <atlcrack.h> // WTL en
// MyWindow.h
class CMyWindow : public CFrameWindowImpl<cmywindow>
{
public:
DECLARE_FRAME_WND_CLASS(_T("First WTL window"), IDR_MAINFRAME);
BEGIN_MSG_MAP(CMyWindow)
CHAIN_MSG_MAP(CFrameWindowImpl<cmywindow>)
END_MSG_MAP()
};
// main.cpp:
#include "stdafx.h"
#include "MyWindow.h"
CAppModule _Module;
int APIENTRY WinMain ( HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow )
{
_Module.Init ( NULL, hInstance );
CMyWindow wndMain;
MSG msg;
// Create the main window
if ( NULL == wndMain.CreateEx() )
return 1; // Window creation failed
// Show the window
wndMain.ShowWindow ( nCmdShow );
wndMain.UpdateWindow();
// Standard Win32 message loop
while ( GetMessage ( &msg, NULL, 0, 0 ) > 0 )
{
TranslateMessage ( &msg );
DispatchMessage ( &msg );
}
_Module.Term();
return msg.wParam;
}
the above program only i got 6 errros
First error:
error C2146: syntax error : missing ';' before identifier 'lpnm'
d:\program files\microsoft visual studio\vc98\include\atlframe.h(1176) : see reference to class template instantiation 'WTL::CFrameWindowImplBase<tbase,twintraits>' being compiled
|
|
|
|
|
|
Hi,
I want to share a CAtlFileMapping object between all simple ATL objects (between all instance of my COM Automation objects).
Basically, I want to load up a file control access to it so that multiple threads will not corrupt it trying to simulaneously write. The file should be accessible to all COM instances so that clients can invoke methods that modify this same file.
Pls advice me as to how I should go about doing this. I've programmed a lot in C++. But I'm completely new to ATL and COM.
Thanks in advace.
|
|
|
|
|
If you are using the single thread model, then COM will serialize all calls to the CAtlFileMapping object on a single thread, so that your object will only get called on one thread. Unless there's something different about the CAtlFileMapping object. It depends on how you CoCreate the CAtlFileMapping. Of course, if the CAtlFileMapping object is registered as "Both", and you are free threaded, you won't get that.
In that case, I would recommend you create a singleton object that all your COM Automation objects call into, and it uses critical sections to protect against calling into the CAtlFileMapping object.
Another solution might be for a custom class factory object. Have the CAtlFileMapping object as part of the class factory. Use CoGetClassObject to get the class factory, QI for your interface. You still need a critical section though, in the class factory to protect multiple access to the CAtlFileMapping.
Once you get past some of the COM/ATL'isms, its very similar to Win32/C++, just use a critical section to be on the safe side.
|
|
|
|
|
Hi everybody,
Does anybody know how to catch Microsoft word application events in a non MFC application (specifically WTL application) ?
thanks in advance,
Roozbeh
|
|
|
|
|
There's too much to specify in detail, but here goes...
Word events are specified as an interface that you (the client that wants to receive the events) have to implement. You tell Word about the interface implementation using Word's implementation of IConnectionPointContainer and IConnectionPoint, which is made simpler if using ATL through the function AtlAdvise.
These two links may help:
COM Events
Event Handling with ATL
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
Thank you very much for your help.
Regards,
Roozbeh
|
|
|
|
|
Hi,
I would like to create a effective antivirus program for microsoft windows OS. It must be a light weight component and doesn't take much of time to load.
can i used WTL for this purpose or otherwise i used to SDK. MFC it take two dlls
extra compare than SDK. can WTL support memory concept like process, Threads, etc..
Write Your suggestion .........
Regards,
G. Inbkumar.
|
|
|
|
|
well WTL is not matured enough , although you can use that.
What is the need of using MFC use Win32 - PSDK.
Also why not try .NET - any language.
but that is only about front end.
What about drivers ?
are you planning to write driver in WTL ?
Regards
Tarundeep Singh Kalra
************************
www.tarunsadhana.com
************************
All men die. Not all men really live”. - “Braveheart”, 1995
|
|
|
|
|
Hi,
I'm not sure about where to start doing this so, here is an example of what i want to do.
Place control1 and control2 on a dialog, control2 will now about control1 and be able to list a properties for example.
maybe i have several control1 on a dialog, control2 will list all control1's in a property.
thanks
Gary Rusher
|
|
|
|
|
hi, i created a dll using ATL COM AppWizard, and also with MFC support in order to create certain GUI...
in effort trying to display a dialog from the dll, i create a simple dialog wif just ok and cancel button, and then run ClassWizard and use Cdialog as it's base class..
in implementation, i try to display the dialog as a modal window using DoModal() function, as coding shown below :
Cdialog1 adialog;
adialog.DoModal();
no error or warning display when i compile, but the problem occur when i run the system, where error code i get was :
Debug Assertion Failed!!
was go thru several books and tutorials from internet, and i think there's nothing wrong wif the coding (just 2 lines coding isnt it =.=")
anyone hv idea about wad's going on??
thx in advance...
|
|
|
|
|
No u must derive ur Class from CAxDialogImpl and not from
CDialog.For this use Insert Menu of VC++ IDE.
Insert->New ATL Object->Miscallenous->Dialog
Give a short name ie. dialog1 ,in ur case
Now call
Cdialog1 adialog;
adialog.DoModal();
also try not to use Class Wizard in ATL COM
Hope this solves ur problem
|
|
|
|
|
thx you so much, the problem solved....
|
|
|
|
|
Hi,
I'm new to Win32 programming, and I have to add dialog resource and management in a static lib in order to be used by other application.
I've added dialog resource in lib project and include all ATL stuff inside lib.
Everything compile ok but ATL create dialog function failed with 1812 error, complaining that no resource are present in exe image.
The base application is a classic win32 project without MFC.
What should I check ?
Thanks
Fabrice
|
|
|
|
|
The tab key doesnt work in Web Browser Control. The following code is supposed to resolve it. However the keydown message is not fired at all. There is another code below this one which is supposed to resolve even this problem but I dont know where to place it.
Code 1:
LRESULT CMyClass::OnKeydown(UINT uMsg, WPARAM wParam, LPARAM lParam,
BOOL& bHandled)
{
// m_spWebBrowser is a data member of type IWebBrowser2.
// Using CComQIPtr in this way queries m_spWebBrowser
// for the IOleInPlaceActiveObject interface which is
// then stored in the pIOIPAO variable.
//
CComQIPtr<ioleinplaceactiveobject,
&iid_ioleinplaceactiveobject=""> pIOIPAO(m_spWebBrowser);
HRESULT hr = S_FALSE;
if (pIOIPAO)
{
MSG msg;
msg.message = uMsg;
msg.wParam = wParam;
msg.lParam = lParam;
hr = pIOIPAO->TranslateAccelerator(&msg);
}
return hr;
Code 2:
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
// Send all keyboard messages to the window of your
// application. hwndApp is the window handle of
// your application.
//
if (msg.message >= WM_KEYFIRST && msg.message <= WM_KEYLAST)
::SendMessage(hwndApp, msg.message, msg.wParam, msg.lParam);
DispatchMessage(&msg);
}
Harshapaul
|
|
|
|
|
hi, i'm currently working on a bho that works tight with image....
as event disp intercepter...i found we need to connect to DIID_DWebBrowserEvents2 in order to intercept event handler under it, but where can i connect to in order to intercept event handler fired by an image events??
thx a lot
|
|
|
|
|
Send me your email address , i will send you dummy BHO Source code that handle DOCUMENTCOMPLETE event.
hope you can modify the rest!!!
"I Think this Will Help"
[Vote One Here,.....]
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|