|
I am about to start using VC++ 2005 but according to the information on MS's website it doesn't not support creation of x64 code.
I found the following page which has instructions for building x64 apps with VS 6 and VS 2003. Would this also work with VS 2005 ?
http://www.devx.com/amd/Article/21313
Is it possible to create x64 code with VC++ 2005 ?
|
|
|
|
|
Just found this page on MS's website which looks promising
http://msdn2.microsoft.com/en-us/library/h2k70f3s.aspx
Anyone tried this with VC++ 2005 ?
|
|
|
|
|
|
I don't understand Microsoft's thinking that a profiler is such a high-level tool, with it only being included in the Team edition of VS 2005. A profiler is an essential part of any development suite to tighten any speed-critical code, but it seems Microsoft would rather everyone produced bloated inefficient software. Microsoft should have included a profiler with all editions of VS, except maybe the Express versions.
Compuware's DevPartner Profiler Community Edition worked OK with VS 2002 and 2003, but it doesn't say it's compatible with VS 2005.
Anyone know of a good profiler (preferably free or cheap) which works with VS 2005 (and in particular VC++ 2005) ?
|
|
|
|
|
Hi all:
Does anybody know how to pass an array as a reference parameter? When the procedure terminates, the content in the array are modified. For example:
<br />
float* ScaleVector(float *src, float deltaT){<br />
float *ret = new float[6*p.n];<br />
float *head = ret;<br />
<br />
for (int i = 0; i < p.n; i++){<br />
float vx = *(src++);
float vy = *(src++);
float vz = *(src++);
float ax = *(src++);
float ay = *(src++);
float az = *(src++);
*(ret++) = vx * deltaT + 0.5 * ax * deltaT * deltaT;
*(ret++) = vy * deltaT + 0.5 * ay * deltaT * deltaT;
*(ret++) = vz * deltaT + 0.5 * az * deltaT * deltaT;
*(ret++) = ax * deltaT;
*(ret++) = ay * deltaT;
*(ret++) = az * deltaT;
}<br />
return head;<br />
}<br />
Because this piece of code will be looped thousand times, it keeps on allocating memories to the temporary array *ret. This leads to the memory leaking of my system. How can I find a way to make a procedure to do the job by modifying the content of the array "*src" passed in instead of returning a separate array please??
Thanks in advance!!!
Asura
|
|
|
|
|
i'd better use stl containers for this :
void Foo(const std::vector<MyType>& constRefArray) {
}
|
|
|
|
|
Hi, just use the pointer to the buffer.
Make an destination buffer float* dest[6*p.n] and give it to the function like
you did with the source buffer.
void ScaleVector(float *src, float *dst, float deltaT){
for (int i = 0; i < p.n; i++){
float vx = *(src++);
float vy = *(src++);
float vz = *(src++);
float ax = *(src++);
float ay = *(src++);
float az = *(src++);
dst[i] = vx * deltaT + 0.5 * ax * deltaT * deltaT;
dst[i*6 + 1] = vy * deltaT + 0.5 * ay * deltaT * deltaT;
dst[i*6 + 2] = vz * deltaT + 0.5 * az * deltaT * deltaT;
dst[i*6 + 3] = ax * deltaT;
dst[i*6 + 4] = ay * deltaT;
dst[i*6 + 5]= az * deltaT;
}
}
But like V2.0 said stl-vectors are a better solution.
codito ergo sum
|
|
|
|
|
In addition to the above suggestion of using vectors etc, you could also use the old methods. Note that I haven't tested it.
//Also make sure that the src parameter is now large enough.
void ScaleVector(float *src, float deltaT)
{
for (int i = 0; i < p.n; i++)
{
float vx = src[i]; // velocity on x axis
float vy = src[i+1]; // y axis
float vz = src[i+2]; // z axis
float ax = src[i+3]; // acceleration on x axis
float ay = src[i+4]; // y axis
float az = src[i+5]; // z axis
src[i] = vx * deltaT + 0.5 * ax * deltaT * deltaT; // calculate the displacement at x axis
src[i+1] = vy * deltaT + 0.5 * ay * deltaT * deltaT; // y axis
src[i+2] = vz * deltaT + 0.5 * az * deltaT * deltaT; // z axis
src[i+3] = ax * deltaT; // added speed at x
src[i+4] = ay * deltaT; // y
src[i+5] = az * deltaT; // z
}
}
this is this.
|
|
|
|
|
I need to launch a GUI application from another application
that is running as a Window Service.
To do that I use the CreateProcess method. This is the code:
<br />
PROCESS_INFORMATION l_ProcessInfo;<br />
STARTUPINFO l_StartupInfo;<br />
<br />
ZeroMemory(&l_StartupInfo, sizeof(STARTUPINFO));<br />
<br />
l_StartupInfo.cb = sizeof(STARTUPINFO);<br />
l_StartupInfo.dwFlags = STARTF_USESHOWWINDOW;<br />
l_StartupInfo.wShowWindow = SW_SHOWMAXIMIZED;<br />
<br />
CreateProcess(NULL, <br />
l_cstrFileToLaunch.GetBuffer(0), <br />
NULL, <br />
NULL, <br />
FALSE,<br />
DETACHED_PROCESS,<br />
NULL,<br />
NULL,<br />
&l_StartupInfo,<br />
&l_ProcessInfo))
The problem is the following:
the GUI application is launched (CreateProcess returns nonzero and I can
see the new process running by task manager) but its windows is not shown
and I can't see its hinstance in the Windows Command bar.
Where is the problem ?
Can someone help me ?
thanks a lot !!!
|
|
|
|
|
Hi ilgale,
your code worked,
whats problem(I run NotePad) and this work
|
|
|
|
|
That code runs ok if executed by an application that runs normally...
but not if executed by an application that runs as a Window
Service.
I've registered an application as a Window Service and I've
started it by the Service Control Manager. In that case the
CreateProcess doesn't let the "child" application to show its window.
|
|
|
|
|
Will something like this help:
AttachThreadInput(
GetWindowThreadProcessId(
::GetForegroundWindow(),NULL),
[YourProcessId],TRUE);
SetForegroundWindow();
SetFocus();
AttachThreadInput(
GetWindowThreadProcessId(
::GetForegroundWindow(),NULL),
[YourProcessId],FALSE);
~RaGE();
|
|
|
|
|
Thanks a lot !!!
but.. what's the HWND object that I have to pass to
SetForegroundWindow and SetFocus functions ?
If I've well understood I've to run that code into the
Service that uses the CreateProcess but.. I need an HWND object to pass to that functions....
|
|
|
|
|
ilgale wrote: If I've well understood I've to run that code into the
Service that uses the CreateProcess
Yes sorry, I had to go away from my desk, so I fired up the post.
This is a snippet used to bring a dialog on the top of the Z-order, i thought it coudl work in your case. I do not exactely know how a service works, but I assume it is a normal Win application started differently. So I believe you must be able to get a HWND with GetSafeHwnd() from within the service.
~RaGE();
|
|
|
|
|
The problem is that the service in not a Win application,
it is a simple C++ program with a main, including MFC
functions. So I don't have an HWND object
I think the problem is in STARTUPINFO object settings...
|
|
|
|
|
I think the problem is that the service is not interactive. You should make it interactive if it is not already.
this is this.
|
|
|
|
|
|
|
Hello
I wanna create a Visual C++ program that encrypt a message and plit the ancrypted message into certain parts,and then the message will be recostructed by a certain amount of parts of the encrypted message.
|
|
|
|
|
For the encryption part, simply type encryption in the combo box on the up left of this page (under code project) and you'll find enough article to help you get a start at it.
For the splitting part, I would try and do a search about zip libraries: they used to provide file splitting algorithms.
~RaGE();
|
|
|
|
|
I am currently trying to complile programs which use the vmr9 direct show filter. Unfortunatly i get an error in MS Vis Studio .NET 2003 saying that it cannot locate the file vmr9.h .
I have installed the DirectX SDK (October 2005) and i cant find the files anywhere for download across the net.
Any ideas ?
Cheers
|
|
|
|
|
vmr9.h is in platform sdk.
-Saurabh
|
|
|
|
|
I am using Visual c++ 6.0
Would you like to give me a Class that make DateTimePicker Flat ?
Urgent
I learn my self
|
|
|
|
|
A bitmap file is in size of 200x100 (pixels).
Now CDC is in MM_LOENGLISH MapMode, If I use ::SetDIBitsToDevice() to print whole bitmap, printed bitmap is very small.
Question:
if Bitmap size is in LOGIC points, the printed image should be in size 2x1 (inches) - but actual printed bitmap is much smaller than that.
so:
is Bitmap size LP or DP?
hint:
DPtoLP changes (200,100) to (33,-17).
A nice hyper tool for optimizing your Microsoft html-help contents.
A best image tool for Windows C++ programmers, don't miss it!.
Includeh10
-- modified at 7:01 Tuesday 28th March, 2006
|
|
|
|
|
hi,
I have set the image for a subitem as follows
LVITEM litem;
litem.mask = LVIF_IMAGE;
litem.iSubItem = 1;
litem.iItem = 0;
litem.iImage = 0;
m_List.SetItem( &litem );
but when I try to call the GetItem to get the image associated with a subitem, its not working(it is working if the subitem is 0). I have set the LVS_EX_SUBITEMIMAGES style of the list control. What else should I do..
Please help me
nave
|
|
|
|