|
If you are not writing C++/CLI code, please repost this to Visual C++/MFC forum. You'll get some replies there.
Best,
Jun
|
|
|
|
|
I work on an app that controls a Canon camera in C#. Until now, I used a common C# wrapper for their SDK. They have a new SDK.
So, I wrote a wrapper in C++/CLI. But, it stopped working, it gives an error : The specified module could not be found. (Exception from HRESULT: 0x8007007E). I found on my notebook that creating a vanilla C++/CLI dll with a simple method, and calling it from C#, compiles but gives this error.
On my desktop, however, it works fine. So, I rebuilt the wrapper dll, and integrated it into my app. The same dll, with the same manifest file ( it's also got one embedded ), gives this error in my app, but runs in a very simple app ( which just calls the same methods ). I think the problem is WinSxS ( which has been an utter nightmare for me from day one ), but I have no idea where else to go, it just plain doesn't work, and gives me no clues as to why. Any suggestions met with gratitude.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Whell did you tried to remove manifest file. When i was trying to use manifest, my app woudn't ran, with a realy strange not common error.
|
|
|
|
|
I've tried every combination of embedded and non embedded manifest files. I have it working on my computer now, but my notebook still cannot generate an exe that works, ever, and I'm still curious to hear people's comments on this.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Christian Graus wrote: I think the problem is WinSxS
We have developed several C++/CLI wrapper DLL's and never seen this problem. WinSxS has not come into play for our applications. Why/how is it for you?
Doing a quick Google for the error number (0x8007007E) I ran accross this quote:
It seems that the encoding parameters in the application config file and
application manifest file must be consistent. Last modified: 6mins after originally posted -- added found content
led mike
|
|
|
|
|
led mike wrote: Why/how is it for you?
At least in part because my notebook is toast, I suspect.
It's possible this is all the problem was.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi all,
I am partly through creating a console application that runs a Windows app. All this I have managed to perform, but the following I am unsure of.
I now need to bring the form to the current view (which I have achieved), then put the mouse pointer in a certain position then simulate pressing the left mouse button.
Can anyone suggest where I need to start looking to allow me to work this one out ?
Pete
|
|
|
|
|
Chances are the first place to look is the Visual C++ forum, it seems unlikely to me that you're using C++/CLI, from your question.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks Christian.... I will see how I go.
From what I have read it's got something to do with the Cursor and not so much the mouse.
Pete
|
|
|
|
|
I know where the problem is, but let's see if I can word an explanation and make it understandable:
As you know, when you send a value parameter to a function, a copy of that value is made. For instance, changing your function signature to someFunction(int i) would mean that a copy of the value stored in "i" is made. Therefore any changes made to "i" in the function itself would not be saved. The way to get around this is, of course, to pass an address or pointer. Your someFunction(int* p) allows you to change the value stored in p.
When you pass a pointer, instead of a copy of the value being made, a copy of the pointer is made. The type "int*" means you can change the value stored at the int location, but you cannot change the address itself. In assigning NULL, you are of course trying to change the address the pointer points to. However, since a copy of the pointer is made, you are only changing the address the copy points to, and not the address the incoming pointer points to.
In otherwords, if you expect to change the actual address of where the pointer points to, you have to pass to the function a pointer to the pointer. The following revised function should work for you:
void someFunction(int** pp)
{
*pp = NULL;
}
Then when you call the function:
someFunction(&p);
|
|
|
|
|
Can you please put such question into Visual C++ forum not c++/cli. This is unmanaged code. And you are putting in managed or mixed forum.
|
|
|
|
|
I wrote a game using OpenGL and C++/MFC. I wanted to port it over to C++/CLI to take advantage of the .NET framework for quicker design/implementation of dialog boxes and some memory management.
I ported over just the terrain algorithm so far, but I have already run into a severe dilemma, where my framerate has dropped from 40FPS to 5-10FPS. Identical algorithms. The difference is in the ported code I use a lot of managed handles rather than unmanaged pointers. To me it doesn't seem possible that memory access via managed handle could be slow enough to kill my rendering rates. But I don't know what else to think.
Can anyone shed some light on if there are significant performance differences between accessing data by managed handle versus unmanaged pointer? Please don't refer me to a gaming site. I have already posted to game dev sites from the graphics rendering perspective. I'm looking to this community for more insight to memory access and handle/pointer operations. Thanks...
|
|
|
|
|
You coud use Mixed mode.
Are you using Managed.DirectX when you port to c++/cli?
|
|
|
|
|
No, I'm not using Managed DirectX. I am still using MFC to create the main application window, and using the HDC handle to use OpenGL libraries directly. This is identical to what I was doing in the "native" MFC app.
Do you think that my native OpenGL calls are somehow bogged down in the "It Just Works" model of mixing managed and native code? I've never used DirectX graphics before. How much time/effort do you think would be involved in learning DirectX, knowing that I at least have a decent background in OpenGL? And do you think using Managed Direct X would make much of an improvement?
BTW, just as a point of interest, I'm using a GeForce 5900FX card. I don't know what it's rating is in triangles-per-second, but I know it's in the millions. My terrain only contains 6100 triangles, which at 10FPS = 0.06 million triangles per second. So that means something is getting SEVERLY bogged down somewhere.
|
|
|
|
|
I don't know much abaut programing with managed DirectX. I know it coems with latest DirectX SDK.
Did you optamize your algoritems for .NET framework?
|
|
|
|
|
No, because right now because almost everything is unmanaged. All of my base classes are still unmanaged. I just changed a couple of the containers to managed. But I have found the problem which I'll post as a reply to myself on the main thread.
|
|
|
|
|
Update...
I have found that the issue is not handles vs. pointers, Managed DirectX vs. native OpenGL calls, or anything like that. It's IDE vs. executable! What I mean is that when I just build the EXE and then run it outside of the IDE, my framerate jumps up to 40FPS. Running in the IDE it immediately drops back to 5FPS.
So then the next logical question is... Does anyone know of any IDE optimizations I can make in order to reduce the problem?
|
|
|
|
|
That's probably because you are running in debug mode. if you press ctrl+F5 instad only F5. You will run it without the debbugging mode. When you came at the problem, and you are using debug build, then yust use atach process, to connect to IDE debugger
|
|
|
|
|
Hi All!
I have this application of mine which works well. It even used to work on Vista. (I work on XP most of the time).
There are some ManagedC++ assemblies in the project.
Now when I try to start the project under vista, when I try to access classes in the ManagedC++ assemblies I get this error:
==========================================
Exception : System.IO.FileLoadException
Message : Could not load file or assembly 'NScribe, Version=1.0.2553.30928, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log for more detail. (Exception from HRESULT: 0x800736B1)
Source : NovaMindEditor
Help :
OSVersion : Microsoft Windows NT 6.0.5600.0
Thread :
Stack :
at NovaQuickStart.Program.StartApp(String[] args)
at NovaQuickStart.Program.Main(String[] args) in C:\Development\Development\Windows\NovaQuickStart\Program.cs:line 59
-------- Caused by Exception --------
Exception : System.Runtime.InteropServices.COMException
Message : The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log for more detail. (Exception from HRESULT: 0x800736B1)
Source :
Help :
Stack :
==========================================
Any ideas?
|
|
|
|
|
are you using:
#using "System.IO.FileLoadException.DLL"
or did you add a reference to project?
And you are in the wrong forum. i saw your file is .cs, so it is C# project. This forum is for c++/cli
|
|
|
|
|
There is no such DLL!!
But thanks for trying
(and yes I have referenced all DLL and it works well on XP..)
|
|
|
|
|
Didn't correctly see.
By the way, witch version of VS you are using.
and start debug your code, and look where exception is thrown, especaly look near filestram.
There mus't be a diffrance
|
|
|
|
|
Well it's on a colleague copmputer.
We use VS2005.
But it's not installed under vista!...
Maybe we ought to try to install C# express and debug with it...
|
|
|
|
|
|
Interesting... thanks!
I'm still very much puzzled by the fact it used to work well until last week.
And suddenly started to exhibit this behavior friday... 
|
|
|
|