|
Hi,
I am facing a problem with compilation order of .idl files in Visual Studio 2005.
My project contain 2 .idl files. When I build the project, sometimes the compilation sequence of these files vary.
I have observed that, when I build application 1st time on a clean machine, order of compiling .idl is different. and after that, on every rebuild the files complier compiles in alphabetical order of filenames.
Which factor decides the build sequence of files in visual studio 2005?
Can we forcefully define the order of building the .idl files? (i.e. specific file must be compiled before/after another)
Please help...
modified on Tuesday, May 19, 2009 2:20 AM
|
|
|
|
|
Easiest thing I can think of (and it's reasonably easy, I guess) would be to rename the file and use a custom build rule (which would just be the MIDL command-line - make sure you copy that before you rename the file). You then specify outputs so that VS knows what it builds, and you can specify additional dependencies, i.e. the things which need to have been built from your other MIDL file.
|
|
|
|
|
Hi,
I developed a webservice with a web method integrating with Microsoft office project and it reads all the tasks and resources inside it with the help of the DCOM 'Microsfot project basic'. It is working fine when i hosted it in IIS in XP but having the issue while hosting in IIS windows server 2003. I am getting the following error when i open the file and it get resolved after giving the enough permission in DCOM security and restart the server but it was avail only for the first time, when i tested it for the second time that shows me the same error.
Given below the error, Kinldy help me out in this.
System.Runtime.InteropServices.COMException: Call was rejected by callee. (Exception from HRESULT: 0x80010001 (RPC_E_CALL_REJECTED))
at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
at Microsoft.Office.Interop.MSProject.ApplicationClass.Quit(PjSaveType SaveChanges)
at Service.CheckProject(String projectID) in C:\vcclient\App_Code\Service.vb:line 41 --
----------
Private gobjProjectInstance1 As Microsoft.Office.Interop.MSProject.Application gobjProjectInstance1 = New Microsoft.Office.Interop.MSProject.ApplicationgobjProjectInstance.FileOpen(FileName) ---
|
|
|
|
|
i use an activex in my source code, but i worry about replacing it. i thought use 2 activex witch one of them check the other but i'm not sure this way is the best even i'm not sure it has a differ!
please help me and tell benefits ans its benefits and galls.
thx
|
|
|
|
|
You should clarify the question,...I found it confusing.
What kind of application is the source code for? Is this a website? Why replace the ActiveX control? And what is the security issue? Is this a networking security issue? You should be more specific, as none of us here know what context you are operating under.
|
|
|
|
|
sorry, you're right.
we produce a hardware lock which use an activex for checking, setting & getting information on lock.
now i'm searching for a way which make replacing activex more difficult.
thx
|
|
|
|
|
...have you considered, LIQUID NITROGEN?
|
|
|
|
|
hi,
i am writting UT code to test my module class it uses some com dll which is having dependencies with some hardware thats why its not registered in my local system. now i want to use interface having in that dll for that i am creating my own stub for that interface. now the problem is i am not able to query my interface CLSID of my interface is not in registry so please any one let me know what i will do to register CLSID of that interface?
also if is there any other way to implement please let me know
thanks,
ashish chandrakar
|
|
|
|
|
|
You cannot use a COM component unless it is registered on the system.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Google for "Registration-Free COM" you will find lots of information, mostly by microsoft. The "trick" is done by using manifests and activation contexts. 
|
|
|
|
|
I’m well aware of the Microsoft support base article stating that it’s not supported to automate office products UI less. It seems that Windows Server 2008 and Excel 2007 enforce the given statement.
I’m running the following code in a NT Service (Local System account) OnStart method. All it does is Excel automation the way it’s working when you run the same code in a Console Application.
The provided code has two parts. The first part launches Excel, creates a new work book and saves it to the given filename. The second part launches a new instance of Excel and opens the given file. The open operation ends in this exception:
Service cannot be started. System.Runtime.InteropServices.COMException (0x800A03EC): Microsoft Office Excel cannot access the file 'c:\temp\test.xls'. There are several possible reasons:
• The file name or path does not exist.
• The file is being used by another program.
• The workbook you are trying to save has the same name as a currently open workbook.
Why was the automated excel able to launch and write files to disk but fails when it’s asked “just “ to open an existing file?
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");
Microsoft.Office.Interop.Excel.ApplicationClass excel = new Microsoft.Office.Interop.Excel.ApplicationClass();
excel.UserLibraryPath, excel.Interactive));
string filename = "c:\\temp\\test.xls";
if(System.IO.File.Exists(filename)) System.IO.File.Delete(filename);
excel.Workbooks.Add(System.Reflection.Missing.Value);
excel.Save(filename);
excel.Quit();
excel = null;
excel = new Microsoft.Office.Interop.Excel.ApplicationClass();
try
{
Microsoft.Office.Interop.Excel.Workbook book = excel.Workbooks.Open(filename,
System.Reflection.Missing.Value,
System.Reflection.Missing.Value,
System.Reflection.Missing.Value,
System.Reflection.Missing.Value,
System.Reflection.Missing.Value,
true,
System.Reflection.Missing.Value,
System.Reflection.Missing.Value,
false,
false,
System.Reflection.Missing.Value,
false,
System.Reflection.Missing.Value,
System.Reflection.Missing.Value);
book.Close(false, System.Reflection.Missing.Value, System.Reflection.Missing.Value);
book = null;
}
finally
{
excel.Quit();
excel = null;
}
GC.Collect();
modified on Thursday, May 14, 2009 4:32 PM
|
|
|
|
|
Hello,
I've written a C# out-of-proc COM server (I delete the Inproc registry entry and add a LocalServer32 entry to get my EXE working as a COM server - then I register a class factory in the server's main method). The server works well when I access it from VB6 (I can instantiate the EXE with CreateObject and always get the same server object from my class factory, as I desire it). Now I need to write a C# client. I instantiate the object via Activator.CreateInstance, passing the progid. I get the server instance. But as soon as I am trying to register an event handler on one of the server's events, I get an AccessViolationException (subscribing events works well in the vb client). Simple method calls without parameters do work. When I run the server in-proc, I don't get the exception.
Is there any possibility to get this working? Or is it fundamentally wrong to simply register the component as LocalServer32?
Thank you,
Thorben
|
|
|
|
|
I am writing a function in C++ that has a SAFEARRRAY as a parameter. I have followed the example from: http://support.microsoft.com/kb/167668[^]. My code is basically the exact as in this example except for the name of the array.
The problem I am running into is that I get the error "E_UNEXPECTED" when calling SafeArrayAccessData. The documentation says that is error occurs when the array could not be locked.
Any Suggestions?
Thank you in advance.
|
|
|
|
|
The line:
if (V_VT(vArray) != (VT_ARRAY | VT_BSTR))
is return TRUE, which make me think that this not a valid array, but in my vb code that calls this function I have a string array that is getting properly assigned.
In the link above, they say, "The key to getting this syntax to work in Visual Basic 6.0 is to first Dim the array variable as a variant, and then ReDim it so that it becomes a variant containing an array of strings. "
Part of the problem is that I am not using VB6.0, I am using .Net 2005. They do not allow the Redim to change the type any longer.
Thanks again for any help you may have.
|
|
|
|
|
Here is my code:
Identifier is passed into the function as VARIANT FAR*
long lLBound, lUBound;
long count = 0;
BSTR HUGEP *strIDs;
SAFEARRAY FAR* ID_Array = NULL;
ID_Array = V_ARRAY(Identifier);
if (V_VT(Identifier) == (VT_ARRAY | VT_BSTR | VT_BYREF))
{
// Get array bounds.
lResult = SafeArrayGetUBound(ID_Array, 1, &lUBound);
if (FAILED(lResult))
{
return count;
}
lResult = SafeArrayGetLBound(ID_Array, 1, &lLBound);
if (FAILED(lResult))
{
return count;
}
// Get a pointer to the elements of the array.
lResult = SafeArrayAccessData(ID_Array, (void HUGEP**)&strIDs);
if (FAILED(lResult))
{
return count;
}
}
SafeArrayAccessData is always returning E_UNEXPECTED. The other functions work fine.
|
|
|
|
|
Hello Cajunman0821,
I tried out your code together with a sample client written in VB 6.0 using the client code given in the MSDN URL you indicated.
Everything worked correctly and I did not get any E_UNEXPECTED error result.
You mentioned that you are not using a VB 6.0 client and are instead using ".NET 2005" (is this a C# or VB.Net app or an app written in another .Net language ?).
My impression is that the client code is either locking the string array (that you passed to your C++ code) or it has not wrapped it properly inside a .Net Object. A .Net Object is used as the equivalent to a COM Variant.
- Bio.
|
|
|
|
|
If V_VT(Identifier) == (VT_ARRAY | VT_BSTR | VT_BYREF), then Identifier contains a pointer to array of BSTRs, and you should use a V_ARRAYREF macro to get access to array of BSTRs.
if (V_VT(Identifier) == (VT_VARIANT | VT_BYREF))
Identifier = V_VARIANTREF(Identifier);
if (V_ISARRAY(Identifier))
{
ID_Array = V_ISBYREF(Identifier) ? *(V_ARRAYREF(Identifier)) : V_ARRAY(Identifier);
...
}
With best wishes,
Vita
|
|
|
|
|
I owe you a beer, Vita.
That worked perfectly. Thanks.
|
|
|
|
|
Hi,
I'm new to COM ports.
Kindly: How can I turn on and Off the bluetooth on my pocketpc/WM5 device using a COM port?
I would like to do this from the front end, from my device.
prefered language = vb.net.
Dikran
modified on Thursday, May 14, 2009 9:34 AM
|
|
|
|
|
is it possible to do this?
|
|
|
|
|
Hi,
I've had a problem when I'm trying to use an activeX function that has a pointer parameter in JavaScript. Other activeX funtions all can be successfully called in javascript. The definition of the activeX function (written in VC++) is shown as follows:
NewCommand(ULONG DevID,ULONG* pCmdStruct) The problem I encountered is how to call this function in javascript.
var a;
a = 1;
var pdat = new Array(1);
pdat[0] = 1;
document.ActiveXObject.NewCommand(a,pdat);
When I use the above sentences, it occurs an error "Run-time error:Type mismatch".
If someone knows something about this topic that can help me, I will appreciate it.
Thanks!
modified on Wednesday, May 13, 2009 2:08 AM
|
|
|
|
|
AFAK ULONG * is not a OLE automation compliant type, hence your ActiveX function cannot be called by the Javascript client (i.e. I suppose you've to define a new interface, automation compliant).
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks a lot!
I've changed the activex function with a pointer parameter included into a normal form (without pointer) and it works all right, and it also realizes the function that I want. 
|
|
|
|
|
pls can someone explain what the moniker mean in com programming hope the explain in visualbasic thx in advance
monem
|
|
|
|