|
This used to be pretty simple (using IWebBrowser2::Navigate) until IE "safe mode" came out. This internet explorer option appears on Vista (and I'm assuming later OS but I have not confirmed that) and seems to be enabled by default. If safe mode is enabled, you will effectively get cut off from the browser instance and your attempt to "post" data gets lost in a singularity or evaporate.
I spent some time looking for a workaround but it seems hopeless. Yet another lashing from the security folks.
|
|
|
|
|
This is basically done using a browser extension.
The web browser loads your extension and passes in a reference to the browser control and also fires events when a web page finishes loading so that you can get access to the web page and manipulate its contents.
You will need different extensions for different browsers like IE, firefox etc. since their architectures are different.
|
|
|
|
|
Well are you asking for automating clicks and submitions, means doing repeating things. then you can simply go for keyboard and mouse event, just search google with msdn in front then there's is a different interesting way too. simply discover how the submitions are being submitted, get tamper data plugin for firefox, check out what parameters are being submitted in HTTP request, and emulate same, many submitions are based around method get, so you simply need to submit parameters in url or otherwise if the submitions are based on method post, then you need to write and send the HTTP request body too. for any way you choose you can go for WININET library to do http work..... that way you'll know more what u r doing amd have much control ovet it.
|
|
|
|
|
|
Please, rephrase your question so that it is understandable (and please, no link to external resources). If you have to put code, put the snippet which is needed, no your full code (and use the pre tags to format the code properly).
|
|
|
|
|
Firstly, your link is broken, it merely comes back to this page. Secondly your question means nothing, loading a bitmap and drawing to a window are separate and distinct. Please try and clarify your problem.
|
|
|
|
|
a04.lqd wrote: please help !!
Are you talking about something like this?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
hai friends
I have a structure with lot of members. I use ZeroMemory to Initialize structure.
ZeroMemory( &Mystruct, sizeof( MyStruct ));
I like to check structure for empty without checking each member. Is any ?
thanks in adance
-kk.tvm-
|
|
|
|
|
You can try memcmp() function.
A a;<br />
ZeroMemory(&a, sizeof(A));<br />
<br />
char chNull[sizeof(A)] = {0};<br />
<br />
int n = memcmp(&a, chNull, sizeof(A));
modified on Monday, December 28, 2009 7:16 AM
|
|
|
|
|
|
kk.tvm wrote: I like to check structure for empty without checking each member. Is any ?
I do not know of any built in function for this. I would suggest the best way is to cast the structure to a byte pointer and then search that for a non-zero byte.
|
|
|
|
|
AFAIK that is incorrect, a inhomogeneous structure may contain padding bytes, and the run-time does not have to clear those padding bytes (it probably would, but it does not have to). So you can't just zero-test all bytes, as that could yield false negatives.
|
|
|
|
|
Nope. It is actually correct, as far the 'Empty' struct is defined as the OP did, i.e. the one obtained with
ZeroMemory( &Mystruct, sizeof( MyStruct ));
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Well,
I've never known it to go wrong, BUT:
Padding bytes are technically 'Undefined', meaning that the underlying architecture can do with them what it wants.
e.g. We have a structure with a single char, followed by three packing bytes. The compiler is at liberty in the interest of optimisation to store the contents of the entire EAX reg to the single char, without clearing the three upper bytes first, thereby loading garbage into the three padding bytes.
I repeat the architecture is at liberty to do so, although in my experience MS compilers sofar apparently never play that dirty. It could become a portability issue though, both to future MS Compilers, or, if the code needs porting to another platform (Linux, Win64?).
Bram van Kampen
|
|
|
|
|
Bram van Kampen wrote: Padding bytes are technically 'Undefined', meaning that the underlying architecture can do with them what it wants.
They're actually well defined if you initialize them like the OP did.
Given the padding issue you may choose one of the following conventions:
- Consider padding bytes as 'members' of your struct.
- Ignore padding bytes
If you follow consistently the convention choosen, then you won't have troubles (the OP implicitely chose convention 1).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
ZeroMemory() will clear the entire structure including padding bytes so no problem.
|
|
|
|
|
yes but I understood the OP wanted to check whether a struct was at its all zero state, where checking all bytes if fine if and only if the hidden bytes got cleared at least once (e.g. with ZeroMemory).
|
|
|
|
|
Not sure if I understand you Luc, but if you use ZeroMemory() it will clear all bytes between start and end of the structure. If, at a later point in time, you do a search through those same bytes for a non-zero value it will tell you if any element of the structure is non-zero. If any padding byte is non-zero then you have an insidious bug in your code.
|
|
|
|
|
That is what I said, checking all for zero is fine provided you ever cleared all (as with ZeroMemory), and not otherwise.
|
|
|
|
|
Luc Pattyn wrote: That is what I said, checking all for zero is fine provided you ever cleared all (as with ZeroMemory)
That's what the OP said in his/her first message.
|
|
|
|
|
Why don't you provide a method? For instance
MyStruct
{
bool IsEmpty()
{
char * p = (char * ) this;
for (i=0; i<sizeof(*this); i++)
{
if ( p[i] ) return false;
}
return true;
}
}
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks friend, it worked well
-kk.tvm-
|
|
|
|
|
Hi All,
Is it possible to use named pipes cross domains?
~ Vikram S
|
|
|
|
|
Hi all
I have make connection through ODBC connection .Connection establish successful.Now i want to retrieve table name from database.
_RecordsetPtr rs;
_bstr_t bt;
HRESULT hr;
CString str;
bt=(_bstr_t)"select * from master.INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE'";
try
{
hr=rs.CreateInstance (__uuidof(Recordset));
ASSERT(SUCCEEDED(hr));
hr1=rs1->Open (bt,cn.GetInterfacePtr (),adOpenDynamic,adLockOptimistic,adCmdText);
ASSERT(SUCCEEDED(hr));
rs1->MoveFirst();
while(!rs1->EndOfFile)
{
str1=(char*)(_bstr_t)rs->Fields->GetItem("tablename")->Value;
m_database.AddString(str1);
rs->MoveNext();
}
rs->Close();
}
catch(_com_error pCE)
{
CString str;
str.Format(_T("\n%s Error: %ld\r\n%s\r\n%s\r\n"),
(TCHAR*)pCE.Source(),
pCE.Error(),
(TCHAR*)pCE.Description(),
(TCHAR*)pCE.ErrorMessage());
MessageBox(str,"Message");
return ;
}
Error show
Microsoft OLEDB Provider for SQL Server Error:-2147217900
Plz help me
modified on Monday, December 28, 2009 4:44 AM
|
|
|
|
|
I am using MFC 9.0 to create Aero Wizard on Vista.
Evrything seems to be OK : creating a prpertysheet, setting the PSH_AEROWIZARD, adding propertypages, etc.
However the next and back buttons only work when the following functions of the currently active page are returning the zero value :
LRESULT OnWizardNext();
LRESULT OnWizardBack();
When the return value is zero, the framework uses the order by which the developer called CPropertySheet::AddPage for each page instance as an information rules for navigation.
However, the developer is allowed, according to the application logic, to override those function and return the dialog resource ID of specific page. That case, the framework navigates to this latter one instead of the default page.
example :
LRESULT CPage1::OnWizardNext()
{
return CPage3::IDD;
}
When the PSH_AEROWIZARD flag is set, unfortunately, this is not accepted : the next and back button do not work.
What's going on ? Is this a bug ?
In this case, is there a way how I can intercept the next and back clicks so I can make explicit calls to CPropertySheet::SetActivePage ?
Thank you in advance.
Easy Profiler : Now open source !
http://www.codeproject.com/KB/cpp/easyprofiler.aspx
|
|
|
|