|
/Oicf is the option I use. This source compiled successfully originally under VC6, and has since been ported to VS.NET and VS2003.
Unfortunately the problem seems to be related to the size/complexity of the IDL source. This source is large. There are several interfaces defined, and one interface alone has dozens of methods. I've tried several times to reproduce the problem with a simpler and smaller file with no luck.
Mike Dimmick wrote: If all of the methods use Automation-compliant types, you can use the Automation marshaller by generating and registering a type library rather than generating custom proxies and stubs.
I had a difficult time getting this stuff to work originally. I'm using COM to implement a UI plug-in architecture. Some of the plug-in's are in-process servers, some are out-of-process. I'm hesitant to try and eliminate the proxy DLL. If I remember correctly, I tried to remove the proxy requirement when I originally created the framework, and it was an exercise in frustration.
I've written a little utility to post-process the proxy code and fix the problem. It's annoying, but I've got far bigger fish to land in the boat .
Thanks for the reply.
Software Zen: delete this;
|
|
|
|
|
Well, when you're trying to make calls between different contexts (COM+ contexts in the same apartment, different apartments in the same process, different processes, different machines) you need something to turn the call params into a data structure that can be sent across the contexts and back into a call again. That's what the proxy and stub give you. The Automation marshaller is just a different way of having a 'standard' table-driven proxy and stub - it just uses the type library rather than a custom built DLL (which turns around and passes a table to a library routine).
A possible workaround might be to put the older Platform SDK path earlier in the Executables path than the Windows Vista (6.0A) path. MIDL.exe is really a Platform SDK tool rather than a Visual Studio tool. You could also try the older standalone Windows SDK Update for Windows Vista (here[^]).
Otherwise, if it's a really blocking issue, contact Microsoft support, or if not blocking, post on the Visual Studio Feedback Center[^].
DoEvents: Generating unexpected recursion since 1991
|
|
|
|
|
Thanks for the detailed reply.
I'll take a look at switching to the Automation marshaller when I do the actual conversion. My current effort is more of a survey for when it comes time for our whole team to convert our products from VS2003 to VS2008.
Mike Dimmick wrote: Otherwise, if it's a really blocking issue, contact Microsoft support, or if not blocking, post on the Visual Studio Feedback Center[^].
Microsoft support currently returns zero search results for "MIDL" and "Visual Studio 2008", and the Feedback Center doesn't have any active 'connections' for VS2008.
I don't like having to use one of my MSDN support incidents to report a bug, but that's what I may end up doing.
Thanks again.
Software Zen: delete this;
|
|
|
|
|
Gary Wheeler wrote: I don't like having to use one of my MSDN support incidents to report a bug, but that's what I may end up doing.
They don't announce it officially, but I believe that if they acknowledge that it's a bug with no (easy) workaround, Microsoft PSS will refund the support incident. (I think they charge the cost of the support incident back to the development team.) That's what my contact in Exchange support tells me, anyway.
DoEvents: Generating unexpected recursion since 1991
|
|
|
|
|
Hello,
I have created a function in an ActiveX DLL similar to the function below:
Public Function f1(ByRef arr1() As String, ByRef arr2() As Double) As String()
End Function
How do I create a SAFEARRAY in Visual C++ to successfully pass both of these arrays?
Regards,
Mike
|
|
|
|
|
|
The data has been put into the SafeArray. However, when reading the data into the VB ActiveX DLL function, I wrote code to display the contents of the array:
Public Function f1(ByRef arr1() As String, ByRef arr2() As Double) As String()
ShowList arr1
End Function
Private Sub ShowList(ByRef arr() As String)
for i1 = LBound(arr, 1) to UBound(arr, 1)
MsgBox arr(i1)
next i1
End Sub
The program crashes.
Regards,
Mike
|
|
|
|
|
That probably means that SafeArray initialization was wrong on the C++ (client) side. How do you perform that task?
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.
[my articles]
|
|
|
|
|
SAFEARRAY* CreateASafeArray()
{
USES_CONVERSION;
char buffer[20];
HRESULT hr= S_OK;
SAFEARRAY *pSA;
SAFEARRAYBOUND aDim[1];
aDim[0].lLbound= 0;
aDim[0].cElements= 10;
pSA= SafeArrayCreate(VT_VARIANT,1,aDim);
if (pSA != NULL) {
long aLong[1];
for (long l= aDim[0].lLbound; l< (long)(aDim[0].cElements + aDim[0].lLbound); l++) {
VARIANT vOut;
VariantInit(&vOut);
vOut.vt= VT_BSTR;
_ltoa_s(l,buffer,10);
vOut.bstrVal= ::SysAllocString(A2W(buffer));
aLong[0]= l;
if (hr= SafeArrayPutElement(pSA, aLong, &vOut)) {
VariantClear(&vOut);
SafeArrayDestroy(pSA);
return NULL;
}
VariantClear(&vOut);
}
}
return pSA;
SafeArrayDestroy(pSA);
}
void CaxDlg::OnBnClickedButton1()
{
SAFEARRAY *pSA3 = CreateASafeArray ();
}
Regards,
Mike
|
|
|
|
|
Hello Michael,
Your VB object method f1 declared arr1() as of type "string".
Your CreateASafeArray() C++ function declared the SAFERRAY as holding elements of type VT_VARIANT.
This is the problem : VT_VARIANT type is not a string. VT_BSTR is.
To resolve the problem, either :
1. Change the signature of f1 to :
Public Function f1(ByRef arr1() As Variant, ByRef arr2() As Double) As String()
ShowList arr1
End Function
or
2. Change the call to CreateSafeArray() in CreateASafeArray() function to :
pSA= SafeArrayCreate(VT_BSTR,1,aDim); // create a 1D SafeArray of VARIANTS
and then make the appropriate changes to the rest of the code in CreateASafeArray().
Hope the above suggestions will help you.
Best Regards,
Bio.
|
|
|
|
|
Bio.,
Your second piece of advice allowed the string array to be read correctly. Thank you.
Regards,
Mike
modified on Thursday, January 10, 2008 11:52:12 AM
|
|
|
|
|
Congratulations, Michael. Best wishes to your project.
- Bio.
|
|
|
|
|
Hi !
Can anybody help me with this error below ?
I try to use MSSOAPLib30.SoapReader30Class.LoadWithParser to send request to an Apache Java Web Service and that Web Service will return documents.
When I tried to call LoadWithParser, it throws an error.
It works just fine before my computer did an automatic update and restart the computer.
After restarting the computer, the code always throw an error below
The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at MSSOAPLib30.SoapReader30Class.LoadWithParser(Object par_source, IMessageParser par_parser, String par_soapAction)
at DxServices.CorazioManagerServices.DownloadDocuments() in C:\\Documents and Settings\\user\\My Documents\\Visual Studio 2005\\Projects\\CSharpDxManager\\DxServices\\CorazioManagerServices.cs:line 14737\r\nSystem.IO.FileNotFoundException: The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at MSSOAPLib30.SoapReader30Class.LoadWithParser(Object par_source, IMessageParser par_parser, String par_soapAction)
at DxServices.CorazioManagerServices.DownloadDocuments() in C:\\Documents and Settings\\user\\My Documents\\Visual Studio 2005\\Projects\\CSharpDxManager\\DxServices\\CorazioManagerServices.cs:line 14737
|
|
|
|
|
Hello all,
I am working on a project in VS 2005.
I am having a VB.NET dll that interactes with some hardware.
I am using this dll's .tlb file in VC.NET
How can I handle the events raised by the VB.NET dll in VC.NET
Pls help it is urgent.
Thanks in advance & a Happy New Year to all of you.
ritz1234
|
|
|
|
|
I have to translate c++ into c# using an activeXcontrol.
The .NET Wrapper translate all dll function into c# calls.
How can I use emtpty parameters like
c++ acontrol.h (header) code:
....
void Fun1(short par1, short par2, short par3)<br />
{ Fun1(par1, par2, par3, COptionalVariant(), COptionalVariant(), COptionalVariant()); }<br />
....
This calls Fun1 using only 3 Parameters
COptionalVaraint is defined as:
class COptionalVariant: public COleVariant<br />
{<br />
public:<br />
COptionalVariant() { vt = VT_ERROR; scode = DISP_E_PARAMNOTFOUND; }<br />
};<br />
The c# .NET wrapper only translates Fun1 with all! Parameters
What do I insert for the empty ones !
Fun1( par1, par2, par3 , null , null, ...) <br /> does not work
I cannot change the wrapper itself, its metadata
is there any c# type for Variant() like
Fun1( par1 , par2 , par3, new Variant(), .... ) ????
|
|
|
|
|
C++ code to stop the ejection of paper from dot matrix printer after the last printed line.
bijumon mathew
kattappana
|
|
|
|
|
This is not the Serial Port Forum.
However, IMHO that is a rather difficult task, your code must access the printer spooler and I don't know if it is even possible. Try to ask the OS/SysAdmin
or the Hardware forum.
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.
[my articles]
|
|
|
|
|
Hi all,
how can I track every left-click of a specific file in a shell extension?
Right-click works with ContentMenu-Handler. Should I use the IQueryInfo extension?
Thx. Jens
|
|
|
|
|
I am using CHtmlView in my Regular MFC application. I have to override registry settings for internet explorer. I want to override GetOverrideKeyPath of IDocHostUIHandler2 interface . (CHtmlView provides notification OnGetOptionKeyPath to override GetOptionKeyPath of IDocHostUIHandler interface which i do not want to use.) Since i am new to Com and ATL I feel a simple example would be better for me. PLease help.
|
|
|
|
|
When I created a project inATL/COM wizard......
First I have tried for DLL and after using EXE i.e. while creating component..
Now both the programs are running finely...
so now whts the difference internaaly in both files???
shailesh
|
|
|
|
|
|
Is that possible to register 32bit deskband DLL in Vista64? I tried regsvr32 the example from VistaSDK without success - it didn't appear in the list of toolbars on taskbar.
Thank you.
|
|
|
|
|
64 bit applications do not load 32 bit DLLs
« Superman »
|
|
|
|
|
hi friends,
1)I have designed .aspx page in which user input the values.
2)when i click the save button, after that the save button should not be visible.
3)Whatever be the design of the .aspx page with values is to be saved as pdf file.
Now My problem starts from here,
I have used itextsharp.dll for creation of pdf files at runtime in asp.net but i don't know how to solve this problem with the help of itextsharp.
i have used many dlls which can be used for .aspx to .pdf conversion on fly but they are not working properly. For Example:PDFizers,ABC pdf,Ntidy,Ghtmldoc.exe etc....
what they all do is converting simple pages to pdf........
but this is complex page containing images and all that........
as per my knowledge about itextsharp.dll, it create pdf file but the designing of the page is not possible with this..(if i am wrong then correct me..)
so what i have to do tell me about this....following is my code of creating pdf file by using itext sharp.
if any suggestion please reply,
all reply appreciated.....
thanks in advance.............
Private Sub function1()
Dim mydoc As iTextSharp.text.Document
Dim str As String
Dim a As PdfWriter
Dim ms As FileStream
cmdSave.Visible = False
str = Server.MapPath("bin\1.pdf")
mydoc = New iTextSharp.text.Document
If File.Exists(str) Then File.Delete(str)
ms = New FileStream(str, FileMode.OpenOrCreate)
mydoc.Open()
mydoc.Add(New Paragraph("123"))
mydoc.Add(New Paragraph("123"))
mydoc.Add(New Annotation("123", "123"))
mydoc.Close()
End Sub
|
|
|
|
|
Do we have an pre-requistes before creating an excel object for a windows application developed using c#?
Is there any sort of memory limitation when creating an excel object. Our application runs fine when few processes are running along with the application, however when the number of other processes are increased then an error is displayed " <b>THERE IS NOT ENOUGH MEMORY TO RUN MICROSOFT EXCEL. PLEASE CLOSE OTHER APPLICATION AND TRY AGAIN </b>". The solution to this error is a system restart, when this error occurs you cannot open any existing excel file too!
Please note that our application has needed excel objects clean up code.
What could be the cause for this error? How to resolve this?
Kindly help!
gauthee
|
|
|
|
|