|
Hi! That's my code to start IE and connect to its events:
void CMFCIEEvtSpyDlg::OnStartIE()
{
if (m_pIE == NULL)
{
HRESULT hr = CoCreateInstance(CLSID_InternetExplorer, NULL, CLSCTX_LOCAL_SERVER,
IID_IWebBrowser2, (void**)&m_pIE);
if (SUCCEEDED(hr))
{
BOOL bAdvised = AfxConnectionAdvise(m_pIE, DIID_DWebBrowserEvents2,
m_pIE4Events->GetInterface(&IID_IUnknown),
TRUE, &m_dwCookie);
TRACE("Advise for DWebBrowserEvents2 %s\n", bAdvised ? "succeeded" : "failed");
m_btnStartIE.EnableWindow(FALSE);
m_pIE->put_Visible(VARIANT_TRUE);
CString strURL;
strURL.LoadString(IDS_HOME_PAGE);
COleVariant vtEmpty;
m_pIE->Navigate(strURL.AllocSysString(), &vtEmpty, &vtEmpty, &vtEmpty, &vtEmpty);
}
}
}
In release bild all works correctly, but in Debug function call m_pIE4Events->GetInterface(&IID_IUnknown) failed (returns NULL). I can't understand, why. Here's a source and compilied release (65 K) [new browser window].
Please, help me!! Thanks!
|
|
|
|
|
When running the next program, I get the next error:
"Unspecified error Microsoft cursor Engine Key column information is insufficient or incorrect. Too many rows were affected by update".
A segment of the program is:
_RecordsetPtr pRs;
_ConnectionPtr m_pConn;
CString sErr;
HRESULT hr=0;
CoInitialize(NULL);
hr=m_pConn.CreateInstance(__uuidof(Connection));
m_pConn->Open (_bstr_t("DSN=egadb"), _bstr_t("scott"), _bstr_t("tiger"),
adConnectUnspecified);
_CommandPtr pCommand;
pCommand.CreateInstance (__uuidof (Command));
pCommand->ActiveConnection = m_pConn; // Formerly opened connection pointer
pCommand->CommandText = "select campo16, campo17, campo18, monto from carga";
variant_t vNull;
vNull.vt = VT_ERROR;
vNull.scode = DISP_E_PARAMNOTFOUND;
pRs.CreateInstance (__uuidof (Recordset));
pRs->CursorLocation = adUseClient;
MessageBox("Ahí voy con el recordset");
pRs->Open( (IDispatch *) pCommand, vtMissing, adOpenForwardOnly,
adLockOptimistic, adCmdUnknown);
CString pfldEName, pfldJob, stmp;
BeginWaitCursor();
try {
for (int i=1; i<2; i++) {
stmp.Format("%s", (char *) (_bstr_t)pRs->GetCollect("campo17"));
CString sValAux="";
pRs->PutCollect("campo18", _variant_t(atof(stmp)));
pRs->Update(vNull, vNull);
pRs->MoveNext();
}
pRs->Close();
}
catch (_com_error &e) {
sErr.Format("%08lx %s %s %s", e.Error(), e.ErrorMessage(),
(LPCTSTR) bstrSource, (LPCTSTR) bstrDescription);
MessageBox(sErr);
}
EndWaitCursor();
}
The table to update has more than 600,000 records. May be is it necessary to establish checkpoints?
Thank you in advance for you help!!
|
|
|
|
|
if i have an ATL Dialog inside a dll library, how can i call it from an MFC program, it is a regular MFC DLL?
|
|
|
|
|
|
i just add a new atl object and in miscelaneus choose dialog
|
|
|
|
|
The ATL object wizard will create a dialogs. However WTL makes life much easier (especially if you are used to the easy MFC life, like I was)
Michael
Logic, my dear Zoe, merely enables one to be wrong with authority. - The Doctor
|
|
|
|
|
I tend to wrap my Dialog in a Simple Object wrapper with a Show Method and then in my MFC App, I create an instance of my object and call the Show method.
Michael
Logic, my dear Zoe, merely enables one to be wrong with authority. - The Doctor
|
|
|
|
|
Hi,
You know when you load a non-normal resource it will open it in some sort of Binary or Hex viewer? Could someone explane very precisly what all of it means? There are three columns, one on the left that appears to mark lines, one in the middle that appears to have the data, and some strange column on the right. I'm most interested in the column on the right.
Thanks,
~ Selevercin
If you have a problem with my spelling, just remember that's not my fault. I [as well as everyone
else who learned to spell after 1976] blame it on
Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
I believe the right most column tries to show the data as text.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
The three columns are in order:
1 Offset - the hexadecimal offset of the beginning of that line (within that resource)
2 Data - hexadecimal representation of that "line" of data. Often 16 bytes is represented/line.
3 ASCII representation of that data.
|
|
|
|
|
Is there a way to copy the "data"? Every time I try, I get the ASCII part of it?
Thanks,
~ Selevercin
If you have a problem with my spelling, just remember that's not my fault. I [as well as everyone
else who learned to spell after 1976] blame it on
Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
What you get on the clipboard is the raw data. No, you can't copy the ASCII representation of the hexadecimal representation of the data. You can however paste it into a "binary file" (MSVC term) window, save that, and then use some "hexdump" command-line utility to get it.
No, I won't write a hexdump utility for you.
|
|
|
|
|
Any program that does this?
This is required when i want to know the resource symbol/ID of the control on the dialog quickly. I hate clicking on properties and finding out what the symbol is.
This is used for ETSLayout, when i'm adding the controls to the panes.
Thanxs in advance!
|
|
|
|
|
Ah found it
http://www.codeguru.com/misc/NITpick.html
Just need to enable the annotate item with ID.
Any other programs?
|
|
|
|
|
I need an unresizable dialog. I was thinking of getting the size at the beginning of the program then if the user tried to resize it I would just reset it back to the original size. However, I've seen programs that don't even display the resize arrows. I tried playing with the dialog settings but it doesn't seem to work. Any ideas?
-Raffi
|
|
|
|
|
dialogs are unresizable by default, and you can disable the max/min/restore buttons in the resource editor.
-c
Garbage collection, making life better - for weenies!
|
|
|
|
|
hmmm, well my dialog is resizable. Do you know what the default settings are? When it is a popup or overlapped dialog it crashes when the program starts. When it is a child it works, but I can't add/remove the min and max buttons. It is a dialog based app. Is that the problem?
-Raffi Yet another example of my bad programming skills.
|
|
|
|
|
oh, i fixed it. really stupid.
-Raffi Yet another example of my bad programming skills.
|
|
|
|
|
go in the resource editor, open your dialog. click the Styles tab. choose "Dialog Frame" as the border type. click Title Bar and System Menu. (and min/max boxes, if you want). those are the defaults.
c
Garbage collection, making life better - for weenies!
|
|
|
|
|
The unhanlded exception error appears at different times when i run this code. Sometimes when i is 100 and sometimes when it's 500.
for (i = 0; i < horzres*vertres; i++)
{
bInfo.bmiColors[i].rgbRed = GetRValue(pCol[i]);
bInfo.bmiColors[i].rgbGreen = GetGValue(pCol[i]);
bInfo.bmiColors[i].rgbBlue = GetBValue(pCol[i]);
bInfo.bmiColors[i].rgbReserved = 0;
}
Thanks very much in advance!
|
|
|
|
|
If you're trying to fill a bitmap with data, they are word aligned internally, and you need to skip the padding at the ned of each row. My GDI+ image processing articles show how - the principle is the same in C++/GDI because the internal structure is the same.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
bmiColors is the palette, not the image.
-c
Garbage collection, making life better - for weenies!
|
|
|
|
|
The BITMAPINFO struct is defined as follows:
typedef struct tagBITMAPINFO {
BITMAPINFOHEADER bmiHeader;
RGBQUAD bmiColors[1];
} BITMAPINFO, *PBITMAPINFO;
It's the bmiColors[1] property i'm confused about. This requires an array to RGBQUAD structs and all i have is a pointer to an array of them, how do i use the pointer when it wants an array?
Thanks
|
|
|
|
|
MSDN :
The RGBQUAD structure describes a color consisting of relative intensities of red, green, and blue.
typedef struct tagRGBQUAD { // rgbq
BYTE rgbBlue;
BYTE rgbGreen;
BYTE rgbRed;
BYTE rgbReserved;
} RGBQUAD;
Members
rgbBlue Specifies the intensity of blue in the color.
rgbGreen Specifies the intensity of green in the color.
rgbRed Specifies the intensity of red in the color.
rgbReserved Reserved; must be zero.
Remarks
The bmiColors member of the BITMAPINFO structure consists of an array of RGBQUAD structures.
And keep in mind that an array is a pointer!
u can always write:
int a[5];
a[1] = 2;
*(a+1) = 3; // Means a[1] = 3;
Papa
Murex Co.
|
|
|
|
|
This bmiColors is the tip of a variably-sized array of RGBQUAD s. Suppose for instance your palette has nBmiColors entries, you'd allocate and stuff the thing like this:
unsigned nBmiColors=256;
BIMAPINFO* lpbmi=(BITMAPINFO *)malloc(
sizeof(BITMAPINFO)+
nBmiColors==0?0:(nBmiColors-1)*sizeof(RGBQUAD));
for(unsigned n=0;n<nBmiColors;++n)
{
lpbmi->bmiColors[n]=...;
}
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|