|
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... 
|
|
|
|
|
If i have in my class a function. And if i delete all calls to that function, without deliting a function it self, Will that function also compile, or it will be excluded from build
|
|
|
|
|
And if a tree falls in the forest and there's nobody there to hear it, does it make...
Yes.
Try this...
void test()
{
#pragma message( "Compiled on " __TIMESTAMP__ )
}
If it's in a cpp file all by itself and it's never used then it shouldn't get linked.
|
|
|
|
|
Thanks. So i must use precompile directives to exclude it from build
|
|
|
|
|
bsaksida wrote: So i must use precompile directives to exclude it from build
That would work
The compiler has no way of knowing if a function/method is used or not since it compiles on a
per-module (cpp file) basis so I suppose it must assume it's used somewhere else.
Mark
|
|
|
|
|
Hi all,
I am using Kellerman Software which is logging library. actully i have to use this library in console base application using windows 2005(vc++).
in which, whenever i run my application it truncate all the contents of LOG file and shows only current log messages.
what i have to use that it appends the new LOG messages not truncate this file and than add.
if anybody have idea about that please reply me.
thanks
bankey
|
|
|
|