|
Hi,
I am working on developing a test application in java. I use java for UI only. I use JNI to communicate with a VC MFC DLL. I launch a IE browser instance in one JNI method, which works fine. I store the browser pointer (IWebBrowser2 *) as a C++ class instance variable. BTW, I start a thread on the native side (_beginthread) which in turn calls the method that launches the browser. If I set the navigation URL (Navigate2) in the method that launches the browser then it works fine. But if I add the same code of navigation in some other JNI method then it does not work. It fails with an error code of 0. Why is this happening? Is there any special care to be taken while working with COM pointers? I am using COM smart pointers.
Thanks,
Nikhil
|
|
|
|
|
Hi,
I'm with problems, when I build DCOM componet, I need call back for client but my service is in DCOM and instance for almost clients, ask Do I do the call back ????
|
|
|
|
|
hi there everybody..
wanted some help.
ne ideas what can be the problem with mycontrol...
it gives a dialog "class not registered" followed by an other one "could not open the document"..
any ideas whether there is a problem with the container or the control?
and where to debug from ..ne ideas??
thanks..
|
|
|
|
|
Dear All,
I am developing an application in MFC VC++ Version 6.0 for Windows 2000. The application consists of two modules :
the application itself, and the other module is Autoupdate feature.
I have to integrate the autoupdate application with the application, but at same time there is no major data exchange b/w the two
modules.
I need to pass only two parameters to the autoupdate : The url containing the new exe , the version number and the name of exe.
The autoupdate feature is used to update the application exe. The autoupdate feature itself doesnot need any further upgradations
So is my questions is that whether it is advisable to make :::
a) the autoupdate feature as a COM component. OR
b) the autoupdate module as a seperate EXE which should be called on click of a button from the application OR
c) put whole of the code of autoupdate in the application it self. OR
d) any other way...which i am not thinking of.
Please send your useful suggestions stating what is the most appropriate way .
Feel free to ask any further queries in this regards,
Thanks
Rohit Dhamija
|
|
|
|
|
Why don't you opt for a normal Dll for Autoupdate.exe. Expose a function say "UpdateApp(...)" from that Dll, and it will have 2 parameters as you said.
Whenever you have to update/upgrade/change the EXE/module, call that function of DLL.
Please tell me whether my understanding is wrong.
|
|
|
|
|
Yeah,That will be fine.
Rohit
|
|
|
|
|
Hi
When I pass VARIANT data type throught COM+ event I am getting null data on client. My Event interface I have defined like this
[id[],mehtod("")] HRESULT OnNewClient(VARIANT pVal);
On client side I have tried in _ATL_FUNC_INFO structure VT_ARRAY|VT_BYREF, VT_RECORD|VT_ARRAY|VT_BYREF, VT_BYREF|VT_VARIANT but nothing seems to be working. The client side method I have declared like this
void __stdcall NewClientLoggedIn(VARIANT *pVal); For passing VARIANT data type do I have to modify Fire_OnNewclient(VARIANT pVal) method. Please help in understanding this.
Thanks in Advance
Girish
Girish Nadig
girish_nadig@yahoo.com
|
|
|
|
|
I've created this simple managed c++ class library:
namespace pkFactorialLib
{
public __gc __interface IFactorial
{
int ComputeFactorial(int n);
};
public __gc class Factorial : public IFactorial
{
public:
Factorial()
{
}
public:
int ComputeFactorial(int n)
{
int intFactorial=n;
for(int i=1; i
|
|
|
|
|
Hi, all
recently i'm planing to make an ie plugin to prevent some(not all) scripts running on ie, or even disable download them from the web, i notice norton antivirus 2003 has some kind of function like that -- script blocking. i originally considered the BHO, but there isn't any events about for script running. anybody can let me know that? thanks.
|
|
|
|
|
Hello !
I have some experience with com/webbrowser/mshtml. Recently I run into a very interesting problem, and after spending some days on it(no success) I decided to try geting some answers from other programmers.
So: I wrote a simple browser helper object. On a machine without internet access, when detecting BeforeNavigate2 event, I redirect navigation. For example, if the user enters http://www.google.com, i redirect to http://mygateway/page.aspx?url="http://www.google.com".
This works fine, the problem is I can't redirect the location of the objects in the document (objects; images; flash; etc), and the page can not load them.
I couldn't find an event that fires when a resource download begins, and a mechanism for redirecting these downloads. (please note that implementing a download manager dows not solve this problem; dm objects are invoked only when the user explicitly selects "download targer..." from the context menu for example).
Please let me know if you have any ideas ( is it possible ? is it not ? a source for more info -> i've already read all I could find in msdn and microsoft on this topic and got no answer ).
I don't need specific code / code samples, I only need a hint on how to do it. I'm not interested in parsing the html code and modifying the links. pages may contain flash/applets, and i can't parse them to change the links. I need browser redirection.
As soon as I'll solve this problem, I'll post the project (no mfc; no atl; just pure C++/Com).
All the best,
psangeljg
ps. I did find a solution, but it's not what I want. I figured that mshtml uses wininet (wininet.dll) to access the resources. I could write my own wininet.dll that calls the actual wininet.dll, changing the urls. However, I try to avoid this soultion, since wininet.dll varies with the os version. Performance is also important.
|
|
|
|
|
The problem is most likely due to relative urls.
You need to rewrite all urls in the orignal document to absolute urls.
|
|
|
|
|
Yep, just like Stefan said.
You can obtain a pointer to the HTML document you have loaded after you get the documentComplete event. Trough that pointer you can get and set for example the sources of the images or objects found on the page.
|
|
|
|
|
that's similar to parsing; you can't manage activex controls, links embedded in flash objects and the like;
this works only for good old fashioned html, and that's not the case here;
I need a tool that can handle any web page; the solution I implemented after one week of searching for alternates was using proxy server.
That's also what igor1960 proposed, and it seems to me it's the only answer. Writing a proxy server is not a very complicated task, so it is an acceptable solution.
|
|
|
|
|
Maybe there is way to do that by setting proxy server?.
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
yes, this is the way I handled the problem in the end. Thanks for your post !
|
|
|
|
|
My problem is: -
I want to access a COM server on a remote machine. I can do it if my local as well as remote machines have been logged on as local administrators. But the moment, I log on as diffrent users, let's say, user1 on local machine and user2 on remote machine OR vice-versa, I get the error "
DCOM got error "General access denied error " from the computer p40217010 when attempting to activate the server:
{263B5191-4822-45D6-9C14-C95C10753764}
"
Firstly I passed 0 for COAUTHINFO in the COSERVERINFO structure,
then I populated COAUTHINFO structure as per MSDN documentention thinking not to use authentication at all to get rid of the problem. But unfortunately this also didn't work.
I can understand that some authentication (security) issue is there, but which issue??
I've been facing this DCOM related problem for last two days.
I would be grateful to you if you could please throw some light to this issue or suggest me some reading stuff to get over this problem
Warm Regards,
Pankaj
|
|
|
|
|
Hi Dears
I've created an Exchange 2000 Store Event Sink in Visual C++ using
______________________________________________________
http://support.microsoft.com/default.aspx?scid=kb;en-us;288156
------------------------------------------------------
I've also created a COM+ Event Sink Application usin
________________________________________________________
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wss/wss/wsst_create_a_com_event_sink_application.asp
--------------------------------------------------------
Now I have to register my "Event Sink"
There is some guidance on thr URL
___________________________________________________
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wss/wss/wsst_registering_an_event_sink.asp
---------------------------------------------------
But I think it's for Visual Basic not for Visual C++ implementation
Please help me...................
I'll be very grateful to you.
Kind Regards
Atif
Watch Your Thoughts for they will become your actions.
Watch Your Actions for they will become your habits.
Watch Your Habits for they will become your beliefs.
Watch Your Beliefs for they will determine your destiny.
|
|
|
|
|
Hi,
I have a java application. It communicates with a VC dll, using JNI. This dll launches IE, using CoCreateInstance(). When I aceess the IWebBrowser2 pointer, I have received from CoCreateInstance(), it works fine for the first time. But when I try to access it (for invoking navigate2()), I get an error with code 0 (ERROR_SUCCESS). Can you tell me what is wrong? What is the meaning of ERROR_SUCCESS? Am I missing any initialization? Is some method needs to be called in every JNI method? Is this happening because the launched browser is a separate process, something outside the scope of a JVM?
HRESULT hr = CoCreateInstance(CLSID_InternetExplorer, NULL, CLSCTX_ALL, IID_IWebBrowser2, (void**)&m_spBrowser);
- Nikhil
|
|
|
|
|
you should take a look at http://www.microsoft.com/com/resources/comdocs.asp
you'll find there micrososft's com specifications. It will take a few hours to read, but if you are not very confident with com initialization, allocation techniques, common client / server implementations, etc, you will find that very useful.
As for your specific question: be sure to use CoInitialize / uninitialize when loading/unloading com.
Also, note that any memory passed thru com interfaces must be allocated and freed using com specific mechanism (like ComTaskMemAlloc), and certain rules for doing this apply. (depending on the type of the variable: in, out, in/out, etc).
Another thing to keep in mind is that all strings passing thru Com interfaces are Unicode strigs (aka OLESTR, array of unsigned chars).
Are you using the internetexplorer with / without graphical interface ? (background or as an activex control in your user interface ?).
It seems to me that you are not using the user interface, case in witch you should stick with MSHTML only, and use url monikers to load web pages for parsing and other tasks.
Please post more of your code and/or some more details to help us figure out what's wrong with the picture.
Angel
|
|
|
|
|
// firstly define interface
IEnumString* pEnumStr;
...
|
|
|
|
|
Hi
I have a ATL COM Object derived from IDispatch.When i create this object i need to attach a windows handle to this object so that i can handle windows messages.
Pls help.I will be grateful if anybody helps me with sampl code or links.
Thnks in advace
Ram
|
|
|
|
|
Hello cberam,
I'm not sure what is the difficulty you are facing. You can certainly obtain the windows handle via a parameter of a method.
Once you have a valid Windows Handle, you can use the Get/SetWindowLong() APIs (with GWL_WNDPROC as the 2nd parameter) to hook its window procedure.
The most important part of this system is that the ATL COM Object must be housed inside a DLL. This is because your windows procedure must reside in the same executable module as the Window Handle.
Does the above help ? If so, I'll see if I can spare some time to write some startup code for you.
Best Regards,
Bio.
|
|
|
|
|
In your question, you said: ATL COM Object derived from IDispatch but if you plan to attach a window handle to this object, you should consider a FULL ActiveX control. You can then use: Project->Add To Project->Components and Controls to insert an MFC wrapper class for your control. If you can't, maybe source code is not available or whatever the other reason. You may write it yourself...
class CMyWindowWrapper : public CWnd
{
public:
void CreateObject() { m_pYourOjbect.CreateInstance(__uuidof(IYourObject)); }
void MyWrapper_Method1() { m_pYourObject->Method1(); }
void MyWrapper_Method2(BSTR text) { m_pYourObject->Method2(text); }
protected:
CComPtr<IYourObject> m_pYourObject;
};
ÿFor the bread of God is he who comes down from heaven and gives life to the world. - John 6:33
|
|
|
|
|
this is a reminder especially for STEVE S, perhaps he didn't notice
my lasts posts in the thread
"programming autocad : GetAttributes"
12:29 12 Aug '03
JPG
|
|
|
|
|
Hi,
I have a VC++(console)/ATL Script host app in which i create COM objects(say for Buttons) dynamically .I like to handle events for these Objects.Will it be possible for to handle events using IConnectionPoint/Sinks ?. Or this is possible only for in case of MFC app.Pls help me.Should i need to migrate from Console to MFC?
Thnks
Ram
|
|
|
|