|
deadlyabbas wrote: the issuse is I am getting a message box getting pooped up while running the application.
And when I comment my change there is no such issue
For a start, what does the message box say?
Also - if m_pIDocument is a smart COM pointer which is of interface type NW_IDocument underneath, then this code is more idiomatically correct:
m_pIDocument.CreateInstance(__uuidof(CADFilter::NW_Document), CLSCTX_INPROC_SERVER);
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi,
Following is the code I am trying to do
#import "C:\\Program Files\\BOSS\\SUPPORT\\RealDWG\\cf2407.dll" rename_namespace("CADFilter")
AcRx::AppRetCode acrxEntryPoint (AcRx::AppMsgCode Msg,
void* AppId)
{
// local variables
int cindex;
CADFilter::NW_IDocument *m_pIDocument;
CLSID clsid;
CoInitialize (NULL);
HRESULT hr = CLSIDFromProgID(LPCOLESTR("NW_Document"), &;clsid );
hr = CoCreateInstance( clsid, NULL,CLSCTX_ALL , __uuidof(CADFilter::NW_IDocument) , (void**)&m_pIDocument );
if(SUCCEEDED(hr))
{
AfxMessageBox(_T("Hi"));
}
}But I am getting an " HRESULT hr as an "Invalid class string"
|
|
|
|
|
Probably means "NW_Document" isn't a valid ProgID.
Easiest way to find a class's CLSID given the DLL that contains it is probably to use the OLE-COM Object Viewer. Use the 'View Typelib' command to open the DLL. That'll display an IDL representation of the DLLs type library, including IIDs and CLSIDs.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Dear All,
I have a debug version of vc++ project.
The project result will be called by other program using COM interface.
I use "/embedding" at "Command Arguments" ( MSVC++ 2005).
It works just fine with XP..I can debug the project.
But not with Vista...the loader program will load another instance instead connecting to the one that aleady loaded in memory..
Did I miss some settings ?
Thanks..
|
|
|
|
|
I am writing an out-of-proc COM server. I would like a single instance of my server to handle all clients. This works OK on Vista for clients running at the same privilege level. But if one client is running at normal privileges and another is running as admin, two separate instances of my server will be launched.
Is there any way to allow a single instance of my server handle all clients?
Wayne
|
|
|
|
|
Hi All
I am getting error error when i am useing InvokeHelper.Function
Declreation in Test Header file
VARIANT Get_List(int* SheetName);
And Define in Cpp file of Test
VARIANT Test::Get_List(int* SheetName)
{
VARIANT result;
static BYTE parms[] =
VTS_PI1;
InvokeHelper(0x60030002, DISPATCH_METHOD, VT_VARIANT, (void*)&result, parms,
SheetName);
return result;
}
use Get_List function in main Class FinalDlg like this
Test objXl;
int sCol=3;
objXl.Get_List(&sCol);
Then i am getting
"Type misMatch" in class wincore.cpp.
Plz help me
|
|
|
|
|
"result" variable is uninitialized.
With best wishes,
Vita
|
|
|
|
|
Thanks for reply.
But result variable is initialize here
VARIANT result;
Sorry can you describe more.
|
|
|
|
|
No, this is uninitialized variable. But it doesn't help as I see the code of MFC.
So, I think that VTS_PI1 is unapplicable here. Use VTS_PUI1 or VTS_PI4.
With best wishes,
Vita
|
|
|
|
|
Ok i use
VTS_PUI1 or VTS_PI4. both now error is same.
If you need example code then i will give you.I need help.
|
|
|
|
|
What declaration of method 0x60030002 do you have? What is a "Test objXl"?
With best wishes,
Vita
|
|
|
|
|
See i don't much about InvokeHelper.I had download a project from Codeproject and make new project with the help of downloaded project.I am sending you a project link which have example code and Dll.
Link is here
Automating Microsoft Excel and Word Together[^]
I am creating a new dll and write a new function.
Public Function Get_List(SheetNumber As Long) As String
' Dim myExcel As Object
Dim Counter1 As Integer
Dim Returnstring As String
Dim myWorkBook As Excel.Workbook
Dim tworksheet As Excel.Worksheet
' myExcel = CreateObject("Excel.Application")
' myWorkBook = myExcel.Workbook.Open("C:\sample.xls")
For Each tworksheet In myWorkBook.Worksheets
' Me.ListBox1.Items.Add (tworksheet.Name)
Returnstring = tworksheet.Name
If iindex = Counter1 Then
Get_List = Returnstring
End If
Counter1 = Counter1 + 1
Next
End Function
And try to access in vc++.Then i am getting error
Plz help me
|
|
|
|
|
Sorry, it requires so much time which I don't have.
Try to call the simpler function, for example,
Public Function Get_List(SheetNumber As Long) As String
Get_List = "aaa"
End Function
With best wishes,
Vita
|
|
|
|
|
i am doing something wrong.See I add function in Dll
Public Function Get_List(SheetNumber As Long) As String
Get_List = "aaa"
End Function
And Declaration in m2msofficecom.h file
VARIANT Get_List(long* number);
And Define in m2msofficecom.cpp
VARIANT _clsExcel::Get_List(long* number)
{
VARIANT result;
static BYTE parms[] =
VTS_PI4;
InvokeHelper(0x60030002, DISPATCH_METHOD, VT_VARIANT, (void*)&result, parms,
number);
return result;
}
And Call in MainDlg Class
_clsExcel objXl;
long ty=1;
objXl.Get_List(&ty);
but still i am getting same error.
plz help me.
|
|
|
|
|
I can only propose that 0x60030002 is not Get_List function. You can look at DLL by "Ole/COM Viewer" and find the declaration of _clsExcel interface.
Can you post the direct reference to your DLL?
With best wishes,
Vita
|
|
|
|
|
please explain in detail.i am also think about 0x60030002 is not Get_List function.But how can i find it.
|
|
|
|
|
VB creates the DLL, which has a TLB inside. Run the "OLE/COM Viewer" and File -> View TypeLib....
Perhaps there is a MFC Wizard which also can import this TLB into code. But I don't know about it, because I use #import directive in C++ client code.
With best wishes,
Vita
|
|
|
|
|
ok i am trying to do that.
|
|
|
|
|
Thanks for smart ans..
Problem solved.
|
|
|
|
|
|
Hi All,
I have say re-compressed a jpeg image using my own compression engine. And have added a reference to this image in a html page through the IMG tag. When i access this html file hosted on the web server using HTTP, I need Internet Explorer to call my decompressor when it sees this particular filetype, decompress the image and display the image just as IE would do for any already established filetype such as jpeg.
I have already used MimeFilter for this but the limitation for MimeFilter is that it can be used to Filter file/MimeTypes only when they are the first resource accessed directly through the Href links i.e. the following link "http://myserver//myimg.xxx" (xxx - my extension) when accessed directly by typing in the address bar would fire the MimeFilter and decompress and display the image. But MimeFilter is limited to only this and cannot be used for other resources embedded in the HTML page like the ones in IMG tag.
My question is whether there is a way to display images of custom filetypes embedded in HTML pages using tags (eg: img tag). Any help would be appreciated.
Regards,
Srini
|
|
|
|
|
i was posting these kind of issues in C# forum.i think this is the correct place to post!
i am using SHDocVw.InternetExplorer with shellwindow (BHO)
in the DocumentComplete event i have registered HTMLDocumentEvents2_Event (click)
my problem:
the click event is called recursively.
i need a solution, once the event is fired, then i want to unregister the event only for the particular button,image,lint etc that i have clicked.
The code i have used inside the oncomplete event as bellow:
HTMLDocumentEvents2_Event DocEvents = (HTMLDocumentEvents2_Event)browser.Document;
DocEvents.onclick += new HTMLDocumentEvents2_onclickEventHandler(DocEvents_onclick);
bool DocEvents_onclick(IHTMLEventObj pEvtObj)
{
if (pEvtObj.srcElement.title != null)
{
MessageBox.Show(pEvtObj.srcElement.title.ToString());
}
return true;
}
|
|
|
|
|
<html>
<head>
<title>
</title>
</head>
<SCRIPT language="JavaScript"
type="text/javascript">
function checkAnswer(quizForm,
theAnswer,
urlRight,
urlWrong)
{
var s = "?";
var i = 0;
for(;i<quizForm.elements.length;i++)
{
if(("cc" ==
quizForm.elements[i].name) &&
(quizForm.elements[i].checked))
{
s = quizForm.elements[i].value;
}
}
if("?" == s)
{
alert("Please make a selection.");
return false;
}
if(s == theAnswer)
{
alert("'"+s+"' is correct!");
}
else
{
alert("'"+s+"' is incorrect.");
if( urlWrong )
{
document.location.href = urlWrong;
}
}
return false;
}
</SCRIPT>
<body bgcolor="gray">
<b>What is JavaScript?</b>
<FORM method="POST"
onsubmit="return checkAnswer(this,'B');">
<INPUT TYPE="RADIO" VALUE="A" NAME="cc">
A. Another name for Java<BR>
<INPUT TYPE="RADIO" VALUE="B" NAME="cc">
B. A scripting language mostly for the web<BR>
<INPUT TYPE="RADIO" VALUE="C" NAME="cc">
C. When you use Java without compiling<BR>
<INPUT TYPE="Submit" VALUE="Submit Answer">
</FORM>
<hr>
<b>Which symbol is used to make comments ?</b>
<FORM method="POST"
onsubmit="return checkAnswer(this,'C');">
<INPUT TYPE="RADIO" VALUE="A" NAME="cc">
A. !!<BR>
<INPUT TYPE="RADIO" VALUE="B" NAME="cc">
B. #<BR>
<INPUT TYPE="RADIO" VALUE="C" NAME="cc">
C. //<BR>
<INPUT TYPE="Submit" VALUE="Submit Answer">
</FORM>
<hr>
<b>Which of the following languages can be used to write server side scripting in ASP.NET?</b>
<FORM method="POST"
onsubmit="return checkAnswer(this,'A');">
<INPUT TYPE="RADIO" VALUE="A" NAME="cc">
A. C-sharp <BR>
<INPUT TYPE="RADIO" VALUE="B" NAME="cc">
B. VB <BR>
<INPUT TYPE="RADIO" VALUE="C" NAME="cc">
C. C++ <BR>
<INPUT TYPE="Submit" VALUE="Submit Answer">
</FORM>
<hr>
<b>When an .aspx page is requested from the web server, the out put will be rendered to browser in following format.</b>
<FORM method="POST"
onsubmit="return checkAnswer(this,'A');">
<INPUT TYPE="RADIO" VALUE="A" NAME="cc">
A. HTML<BR>
<INPUT TYPE="RADIO" VALUE="B" NAME="cc">
B. XML<BR>
<INPUT TYPE="RADIO" VALUE="C" NAME="cc">
C. JSP<BR>
<INPUT TYPE="Submit" VALUE="Submit Answer">
</FORM>
<FORM method="POST"
onsubmit="return checkAnswer(this,'B');">
<INPUT TYPE="RADIO" VALUE="A" NAME="cc">
A. Another name for Java<BR>
<INPUT TYPE="RADIO" VALUE="B" NAME="cc">
B. A scripting language mostly for the web<BR>
<INPUT TYPE="RADIO" VALUE="C" NAME="cc">
C. When you use Java without compiling<BR>
<INPUT TYPE="Submit" VALUE="Submit Answer">
</FORM>
</body>
</html>
|
|
|
|
|
Good luck with this....You'll need it as this is a COM forum.
Steve
|
|
|
|
|
Hi
I had BHO developed in vs2005. I work on IE6.
I do all the things when the progresschange event fires...
http://msdn.microsoft.com/en-us/library/aa768283(VS.85).aspx[^]
The main thing is
when I open 3 instances of IE,
consider
in first instance, http://www.google.co.in/[^] is opened,
in second instance, http://www.msn.com/[^] is opened,
in third instance, http://in.yahoo.com/?p=us[^] is opened.
when these are opened the ProgressChangeEvent is fired,
but when return back to the window of 2nd instance (i.e.,http://www.msn.com/[^]) and refresh it, no progresschangeevent is fired.
which event can be fired when changing the focus from one window to other,
"WindowStateChanged" event should be fired, but when I open solution explorer of my project, this event is not visible in intellisense. Why WindowStateChanged event is not obtained in my Project solution.
And, using the BHO can't we get the handle of previously opened instance(which is currently active, like 2nd instance after openeing three instances of IE.)
I had already posted this in http://www.codeproject.com/Messages/3165774/Csharp-BHO-problem.aspx[^]
but I think this is the forum that I can get some suggestions.
I was doing all these in Windows XP Service Pack 2 (SP2).
|
|
|
|