|
You're again start from NULL.
Is this code running in a BHO?
If so you it gives you the IWebBrowser2 object in the SetSite method.
You must start from here.
Search for the required element by tag name and then use QueryInterface on the returned IDispatch pointer to get to the IHTMLElement pointer.
|
|
|
|
|
No my code is not running in BHO. It's an exe.
Actually i want to save WebPage's filled values with 'id'of the field. So that in future i can refer a (saved) perticular field value with respect to it's Input-element 'id' value .
I able to do both save & refer the value of a field with respect to the value of Input-element 'type'. But problem is there, if suppose a web page having 2 TEXT-type fields --Text1 & Text2,then when i'm after saving those values, referring the values ,my code pointing those Text1 & Text2 fields's values as if the values of Text1 field. Because both field's Input 'type' element's value is same "text".
Actually i'hv to save the LoginPage field value of 'www.redbox.com'.But it's most fields don't have common Inpute element 'name'.Other wise we could have a abstract by IHTMLInputElement->get_name()
Only way, we can point both values of 2 different TEXT-type fields separately by saving their values along with Input 'id' element's value respectfully.Because we can notice id's of 2 different TEXT-type field's are different even though their Input 'type' value[text] are same .
So can you please rectify my last code stuff .
|
|
|
|
|
This reply is 2 months after the fact but I'm throwing it in for the benefit of anybody reading later, as LOTS of people come here to solve many problems.
As with most of MSHTML and/or the WebBrowser control, the IHTMLElement::get_id method is grossly misdocumented. It does not take a BSTR as a parameter. If you look at the disassembly of the method actually executing, it requires 12 bytes of parameters before THIS is placed on the stack. The crash is occuring because it's pulling 12 bytes OFF the stack instead of the 4 bytes the docs would have you putting there. And there's your crash: a corrupted stack that just lost 8 bytes it wasn't expecting to lose. Without using machine-dependent assembly language, I'm not sure how you would get the compiler to accept putting 12 bytes on the stack instead of the 4 that's expected. In assembly it's easy. You can tweak the interface definition in the header file as others have had to do on other issues, but I'm not sure what the parameters are supposed to be. I'm not even sure what the method does, I can only promise it has nothing to do with retrieving an ID. The 8 extra bytes on the stack are ignored, and the last parameter (the one that's supposed to be a BSTR) has its lower 16 bits set to 0. That's all it does. Within the scope of very limited time, I tried everything I could think of with the parameters - even puting a VT_BSTR on the stack - and couldn't pin it down. Nothing ever happened except the low word of one dword out of 3 (or 4 if you count THIS) in the parameters was changed to zero.
My advise is, consider the method not to exist.
|
|
|
|
|
I am creating a software suite that will involve mobile platforms along with multiple operating systems
I am mostly efficient in c/c++/c# along with socket communication.
I originally designed the software to use TCP communication to relay information between the "base" application and the client applications.
However I am missing a crucial step in the design... I am not sure how to "connect" to this server or base computer I have a domain name that I can use, but how is it that I relate that information to the server application? I want this server app to be in c# .net, but am willing to migrate to a different solution if deemed easier. Is there a js script that I can make that will do this for me?
For more info on the type of application this is.. think of it like a IM program that the server must know all the clients connected and send global messages to
--addition
I can think of one solution but it truly seems very inefficient
I can have a file on my server and every 30seconds on a worker thread check for connected devices, when a client system connects to the server it registers itself on the list
-- or
when the server comes online the server stores its IP information in this file, when a client comes online it checks this file for the servers IP information and then creates a socket based on the information in the file to communicate with the server
Suggestions, comments are greatly appreciated!
modified on Sunday, June 27, 2010 7:56 PM
|
|
|
|
|
Greg Mort wrote: I am mostly efficient in c/c++/c# along with socket communication.
Greg Mort wrote: However I am missing a crucial step in the design... I am not sure how to "connect" to this server
Surely some contradiction here. If you understand sockets then just use socket connection, standard client server application.
It's time for a new signature.
|
|
|
|
|
Richard MacCutchan wrote: Surely some contradiction here. If you understand sockets then just use socket connection, standard client server application.
uh...
you clearly don't see the issue, so thanks but no thanks
For anyone that is willing to help I do greatly appreciate it, to be a little more specific...
It is not a simple intranet connection that I am trying to create
I have a domain name that I can use, this domain name has a dynamic IP and I do not have any server type applications on this domain name I have a computer (not affiliated with the domain) that represents my server application. I have multiple client applications that reside on mobile phones and other computers. These client applications need to be able to know how to connect to the server without knowing the exact IP of the servers computer because it will always be changing. That is why I suggest this file system on my domain name where when a server computer is running it updates the domains server file with its IP information that way a client can access this file and connect to the appropriate IP address.
Greatly Appreciated
Thank you
Greg
|
|
|
|
|
Hi,
How to resize property sheet button?
|
|
|
|
|
|
Hello,
I have a problam : my program is work well at windows xp but not at
windows 7 (I'm opening a file to write and read).
I created a manifest with:
<ms_asmv2:trustinfo xmlns:ms_asmv2="urn:schemas-microsoft-com:asm.v2">
<ms_asmv2:security>
<ms_asmv2:requestedprivileges>
<ms_asmv2:requestedexecutionlevel level="requireAdministrator">
<ms_asmv2:requestedexecutionlevel>
<ms_asmv2:requestedprivileges>
<ms_asmv2:security>
<ms_asmv2:trustinfo>
I added the manifest to the project by:
Properties->Manifest Tool->Input and Output
and adding the name of the manifest file under Additional manifest files.
(I followed the MSDN instructions "Create and Embed an Application Manifest (UAC)")
but its don't work , does anyone can halp me with this?
thanks
|
|
|
|
|
Project settings -> Linker -> UAC-Level.
Better is writing your file to the user dir.
Remember: you cant access the dir that you dont own.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Thank you, it's work wall this way, can you give me more detail about
"Better is writing your file to the user dir.
Remember: you cant access the dir that you dont own"
I'm a new programer.
thanks again
|
|
|
|
|
I found an article from the legendary Mark Russinovich:
http://technet.microsoft.com/en-us/magazine/2007.06.uac.aspx
which is really worth reading and understanding. Believe me investing one or two hours to understand it is good invested time. You wont regret it, thats how Windows works.
Or this one
http://www.codeproject.com/KB/vista-security/UAC__The_Definitive_Guide.aspx
in which I found the link.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
A class is sub of CPropertyPage.
Several classes are sub of the class.
code looks like:
class Base : public CPropertyPage
{
enum { IDD = PAGE_BASE };
};
class Sub0 : public Base
{
};
class Sub5 : public Base
{
};
Non-default constructor of class Base, such as Base(int iType), needs to be used to identify sub classes of Sub0 - sub5.
For this reason,
DECLARE_DYNCREATE(Base)
and
IMPLEMENT_DYNCREATE(Base, CPropertyPage)
have to be deleted.
Is it harmful if deleting the 2 pieces of code?
|
|
|
|
|
I dont think so. Comment them out, if you need them later.
If you use the macros, they should implemented in EVERY class properly.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Hello Includeh10,
I would like to ask a few usage policy and quesions on the barcode application you developed and posted on Code Project site in Mar 2006. Could you please respond by Test E-mail?
Looking forward to hearing from you.
Best regards,
-/Madhav
|
|
|
|
|
I'm trying to create a RichEdit without any borders tried to set off ES_SUNKEN, WS_EX_CLIENTEDGE but nothing works: it keeps coming with that ugly sunken border. Has anyone a clue, or better, an example in C or C++?
PS. of cource ES_MULTILINE,ES_AUTOHSCROLL,ES_AUTOVSCROLL are on...
Thanks in advance...
Rozis
[Update]
I found out i was still using version 1. Did some changes to support version 3 and 4.1. Because the control displays correctly (apart from that ugly border) I conclude this code must be ok. WS_EX_CLIENTEDGE ultimatly leads to SetWindowLong(). So I thought to be smart and set everything off, like this:
SetWindowLong(whnd,GWL_EXSTYLE,0)
To my surprise it still displays the border! What i want to get rid off is WS_BORDER, WS_EX_CLIENTEDGE and WS_EX_STATICEDGE.
For version 4.1 I use Loadlibrary("MSFTEDIT.DLL") and classname "RichEdit50W". The MS-documentation says not all styles are implemented, so i thought maybe it is not possible. Your reactions indicate i'm not right... But i still can get it to work.
Someone any (win32) suggestions?
[Solved]
Used Spy+ to find out wich styles where there. Used Setwindowlong() to put the styles in. I think this was a quirk of my gui-classes
Thanks anyway
[End Update]
modified on Friday, July 2, 2010 4:15 PM
|
|
|
|
|
This works ok over here
...
AfxInitRichEdit2();
...
DWORD dwStyle = ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN | WS_TABSTOP | WS_VISIBLE;
CRect rc(200, 200, 600, 600);
wndRichEdit.Create(dwStyle, rc, pWndParent, 30000);
If you create the control in the resource editor, all you have to do is set Border to false
|
|
|
|
|
And what about WS_EX_CLIENTEDGE and WS_EX_STATICEDGE?
|
|
|
|
|
What about them? Did I maybe misunderstand your problem?
The code I supplied creates a CRichEditCtrl without any borders at all. I tested it on my end. Was that not what you wanted?
|
|
|
|
|
Look there http://msdn.microsoft.com/en-us/library/bb787873(VS.85).aspx
I guess that your form style like win98. To turn on XP or later versions style, include this code:
#if defined _M_IX86
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_IA64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_X64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#else
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\""
#endif
|
|
|
|
|
I'm not using MS-stuff. Do you know if there's a win32 equivalent?
Thanks, Rozis
|
|
|
|
|
Hi sir
I have some strings which i am reading from database.
I want to comapare the strings with the given character and sort it Alphapatecially
For example if the given character input is "s".it should compare with the
given strings and get the result only with "s".
For example the strings are aa,bb,cc,ss,sss,sss
It should compare and get ss,sss,sss.
Any easy way or any help appreciated
Thanks
Raj
|
|
|
|
|
You have two possibilities: When extracting from the database ignore all strings that do not match the prefix character. Alternatively when sorting filter out all strings that do not match before sending to the sort function.
It's time for a new signature.
|
|
|
|
|
Dear You should handle by database query with using "where" and assending statment .
|
|
|
|
|
If you only want the strings for one purpose then it's probably more efficient to lean on your RDBMS and let it do the filter and sort for you. If, on the other hand, you want the strings for a variety of groovy purposes then you can filter them on the client side using a couple of algorithms from the C++ standard library:
#include <algorithm>
#include <string>
#include <vector>
#include <iterator>
#include <iostream>
std::vector<std::string> create_test_data()
{
std::vector<std::string> strings;
strings.push_back( "aa" );
strings.push_back( "bb" );
strings.push_back( "cc" );
strings.push_back( "ss" );
strings.push_back( "sss" );
strings.push_back( "sss" );
std::random_shuffle( strings.begin(), strings.end() );
return strings;
}
void print( const std::vector<std::string> &data, std::ostream & to )
{
std::copy( strings.begin(), strings.end(), std::ostream_iterator<std::string>( to, "\n" ) ) << std::endl;
}
int main()
try
{
std::vector<std::string> strings( create_test_data() );
print( strings, std::cout );
strings.erase(
std::remove_if(
strings.begin(),
strings.end(),
[]( const std::string &str ){ return str.front() != 's'; } ),
strings.end() );
std::sort( strings.begin(), strings.end() );
print( strings, std::cout );
}
catch( std::exception &e )
{
std::cout << "Something went wrong: " << e.what() << std::endl;
}
catch( ... )
{
std::cout << "Something went wrong, no idea what!" << std::endl;
}
The two important lines are:
strings.erase(
std::remove_if(
strings.begin(),
strings.end(),
[]( const std::string &str ){ return str.front() != 's'; } ),
strings.end() );
std::sort( strings.begin(), strings.end() );
as they're the lines that filter and sort the strings.
The first one removes any string that doesn't start with an 's' character. I've used a lambda to do the comparison - if you're not using a very up to date compiler you might have to replace that with a function object. Holler if you need some help. As remove_if has some funky behaviour (it can't resize the range it's filtering) you have to resize the vector - which is what erase is doing. Have a look at "Effective STL" by Scott Myers for a good treatment of why this happens.
The second line just sorts the remaining strings into alphabetical order.
Hope this helps, please scream if you need more help with this and don't decide SQL is the way to go!
Cheers,
Ash
Edited to play around with formatting a bit...
modified on Saturday, June 26, 2010 10:11 AM
|
|
|
|