|
Don't post your spamming crap here, thank you very much!
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
|
I've been experimenting with this for weeks with no success. Basically, what I wanted to do is to use mshtml to render a html page in an ordinary window (form, or control), but I don't want to create a webbrowser object (from the shdocvw.dll or anywhere else)! MSHTML is claimed to be a html parser, renderer, and editor, I think it'd be neat and beautiful to just use it to render a html page in any winodw without the extras from a webbrowser object. I've tried over ten example projects from this website and they all need to create a webbrowser object one way or another, which seems redundent or which is a necessary step? Any ideas from you all?
|
|
|
|
|
I'm pretty sure you would need a control which is capable of rendering HTML like the web browser control or a word document object.
I believe MSHTML is a parser of HTML and not a renderer.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
I am not sure about what you believed since according tp msdn:
"Mshtml.dll is at the heart of Internet Explorer and takes care of its HTML and Cascading Style Sheets (CSS) parsing and rendering functionality. "
|
|
|
|
|
Rendering is always done by a control. Examples.... web browser control, media player control, a view, edit box.... Something that is visible.
Does MDHTML have any such visible views?
You certainly will not able to render HTML in an edit box.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Hello everyone,
I am creating the ATL COM project using VC++ in VS2008.
My project need to access the database from the mysql.
I have installed the mysql ODBC connector.
Please tell me how to connect to mysql through
my ATL COM project and how to insert , delete data from the tables present in my database.
|
|
|
|
|
Now i am able to do that.
i can connect to mysql,edit,delete and insert a
new record in the database.
|
|
|
|
|
how to write corba application from java to java????????
|
|
|
|
|
This looks like a java question; I would suggest you post it to the Java forum.
|
|
|
|
|
Hi,
Again I am here with new one.
Following is the code , I am attaching the instance of excel to active excel.
Excel::_ApplicationPtr XL;
Excel::_WorkbookPtr book;
string XLWBName;
try
{
CoInitialize(NULL);
HRESULT hr = XL.GetActiveObject(_T("Excel.Application"));
book = XL->;Workbooks->;Item[1];
XLWBName = book->Name;
return true;
}
catch(_com_error &error)
{
cout << "COM error"<< endl;
return false;
}
I implemented this in two applications:
In 1st application it is working perfectly , after coinitialize i kept the breakpoint then it is called 2 methods from comip.h
1st is:HRESULT GetActiveObject(const CLSID& rclsid) throw()
2nd is: HRESULT GetActiveObject(LPCWSTR clsidString) throw()
In 2nd application it is not working and checked the sequence of methods calling from comip.h, its calling only one method that is :
HRESULT GetActiveObject(LPCWSTR clsidString) throw()
Checked the value of book and other instances:
((*(IUnknown*)(&(*(IDispatch*)(&*((book).m_pInterface)))))).__vfptr
__vfptr = CXX0030: Error: expression cannot be evaluated
[0] = 0x0046d5b0 _com_error::`scalar deleting destructor'(unsigned int)
__vfptr = 0x004f5af4 const _com_error::`vftable'
please give me clue where I am doing wrong or something need to be added?
Regards,
Gtag
|
|
|
|
|
Is the second application compiled with Unicode turned on? Because your passing an LPCTSTR (which can be ASCII or Unicode, depending on pre-processor macro settings) to GetActiveObject, where you are meant to pass an LPCWSTR
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Sorry I am new to this, I searched for this option, i didn't find it?
Please tell me where I can find this option in Microsoft visual studio 2008(Professional edition).
Regards,
gtag
|
|
|
|
|
Don't worry too much about that - just make sure you use
L"Excel.Application"
instead of
_T("Excel.Application")
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I changed it , but same issue.
Is there any other way?
Regards,
Gtag
|
|
|
|
|
What HRESULT was returned from GetActiveObject?
Was Excel running when you did the GetActiveObject call?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
hr = 0x800401e3 Operation unavailable
Excel was running.
With other application I can attach with both option s _T or L.
Even can read xlworksheet names and all.
Regards,
Gtag
|
|
|
|
|
gtag wrote: hr = 0x800401e3 Operation unavailable
Right - well that explains why you weren't getting a pointer to the Excel application. Doing a quick Google (you know, like you could have done) brings up this MS support page[^] which deals with your scenario.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Surely I will check out the blog u mentioned.
After doing little analysis on both the applications I have got few inputs for not getting attached to active object, but solution I couldn't?
Following are the functions called from comip.h
HRESULT GetActiveObject(const CLSID& rclsid) throw()
{
_Release();
IUnknown* pIUnknown;
HRESULT hr = ::GetActiveObject(rclsid, NULL, &pIUnknown);
if (SUCCEEDED(hr)) {
hr = pIUnknown->QueryInterface(GetIID(), reinterpret_cast<void**>(&m_pInterface));
pIUnknown->Release();
}
if (FAILED(hr)) {
// just in case refcount = 0 and dtor gets called
m_pInterface = NULL;
}
return hr;
}
// Attach to the active object specified by clsidString.
// First convert the LPCWSTR to a CLSID.
//
HRESULT GetActiveObject(LPCWSTR clsidString) throw()
{
if (clsidString == NULL) {
return E_INVALIDARG;
}
CLSID clsid;
HRESULT hr;
if (clsidString[0] == '{') {
hr = CLSIDFromString(const_cast<LPWSTR> (clsidString), &clsid);
}
else {
hr = CLSIDFromProgID(const_cast<LPWSTR> (clsidString), &clsid);
}
if (FAILED(hr)) {
return hr;
}
return GetActiveObject(clsid);
}
Of these functions one func is having "_Release();" . This is not getting called in one of my application and error is which i mentioned in previous post.
I wonder that same code works perfectly in one application on same pc and in other it's not.
Anyway I will check the workaround thing which u mentioned.
Thank you
Regards,
Gtag.
|
|
|
|
|
Read the page I pointed you at. Don't bother digging through the Microsoft library code - the error is not in that.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
NO, I am getting same error value in hr.
I am still trying.
As I am mentioned in above , "_Release();" is not getting called.
I checked in other app where it is working if I right click on _Release() and see the definition , nothing is reflecting overthere but when I did the same thing in current app(where its not working) , symbols are not loaded it is showing.
Is this the issue?
Regards,
Gtag
|
|
|
|
|
Hi Stuart,
Thanks for helping me in this issue.
Today I resolved the issue.
It has to do with security, as my application is having service which runs under "System" user name and Excel runs under other login not system, so it was not accessing excel under other login.
Now I am able to access active object.
Thanks once again.
|
|
|
|
|
Here is my C# file.
using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.IO;
using System.Runtime.InteropServices;
namespace AdobeDSL
{
public class DSL
{
public DSL()
{
}
public string GetID(string username)
{
}
public string Verify(string ID)
{
}
}
}
Then I have this C++ file.
#import "Path\AdobeDSL.tlb" named_guids raw_interfaces_only
#include <iostream>
#include <string>
using namespace std;
int main()
{
CoInitialize(NULL);
AdobeDSL::_DSLPtr DSLTest;
HRESULT Result1 = DSLTest.CreateInstance(AdobeDSL::CLSID_DSL);
if (Result1 == S_OK)
{
cout << "Worked!" << endl;
}
CoUninitialize ();
cin.get();
return 0;
}
This all works just fine. But I should be able to call DSLTest->GetID("value");
GetID and Verify do not show up in the members list. What do I have to do to get them to show up.
|
|
|
|
|
Did you try calling them?
It could be an intellisense problem.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
I wish it was that easy. If I try to call the functions, I get an error saying the member does not exsist.
|
|
|
|