|
The autorun will consist of several buttons which all when pressed open a file on the file system or a directory.
|
|
|
|
|
So you thought there was some chance that would help him i guess? I believe I have better odds of hitting the lottery.
led mike
|
|
|
|
|
I was just answering the question. I'll leave the "Was it helpful?" up to the OP.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
nike_arh wrote: My question is does C++ have any prerequisites??? Should i write the autorun on C++ some other language (Java perhaps)??? I am using Visual Studio 2005.
Your question leads to two some ways:
1. Native code:
A. MFC:
a. Dynamic link to MFC: You have to include all dependent MFC DLLs.
b. Static link to MFC: This is the prefered way for an autorun exe.
B. Win32 SDK: This is also prefered.
2. Managed code:
This is something like C#.
Maxwell Chen
modified on Monday, March 10, 2008 2:59 PM
|
|
|
|
|
Maxwell Chen wrote: Your question leads to two ways:
Your answer leaves many gaps
led mike
|
|
|
|
|
led mike wrote: Your answer leaves many gaps
I got what you meant...
Maxwell Chen
|
|
|
|
|
All the answers leave many grins (and visions of fish fillets)
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I hear you brother. Will it run on "any PC"?
What would really be helpful is a Filet-O-Fish CD, you put it in "any PC" and the PC gives you a Filet-O-Fish sandwich.
led mike
|
|
|
|
|
led mike wrote: What would really be helpful is a Filet-O-Fish CD, you put it in "any PC" and the PC gives you a Filet-O-Fish sandwich.
I've been working on that, but I have doubt.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
send me the codes pleeeezzzzz it's ORGENT I'm hungry
led mike
|
|
|
|
|
led mike wrote: I hear you brother. Will it run on "any PC"?
What would really be helpful is a Filet-O-Fish CD, you put it in "any PC" and the PC gives you a Filet-O-Fish sandwich.
Maxwell Chen
|
|
|
|
|
It looks like there won't be an autorun.
|
|
|
|
|
nike_arh wrote: It looks like there won't be an autorun.
Don't say things like that! Think about the reactions on Wall Street!
led mike
|
|
|
|
|
You can statically link all the dependencies to a C++ program and run it from a CD. You can even choose not to link any run time libraries at all and make a "pure" Win32 program.
|
|
|
|
|
I'm attempting to work with PropertyGrids in Visual C++ for the first time, and I'm having difficullty figuring out how to change the Attributes. I want to change the Category as well as the Descriptions, but the only documentation I can find on this is for C#. According to that I'm suppose to use the [Description] and [Category] attributes before the property, but when I use them in C++ I get attributes not found error. I tried creating these as custom attributes but that didn't effect the grid. Is there another way to do this? Are there different attributes to use? Or is there some special Attributes library I've not included?
Thanks!
|
|
|
|
|
So if you are doing .NET development in C++ so C++/CLI you should be in the C++/CLI forum. This form is for C/C++ development.
Your problem could be that you have not referenced the appropriate assembly. The assembly needed is included in the documentation.
led mike
|
|
|
|
|
Hello
I have downloaded this code from the internet and I am trying to compile it. Howerver, I keep getting these 2 errors which I cannot seem to solve.
Error C2491 StartNativeProcessing definition of dllimport function not allowed
Error C2491 StartNativeProcessingWithControlProc definition of dllimport function not allowed.
Many thanks for any assistance with this code.
Steve
#ifdef NATIVEDLL_EXPORTS<br />
#define NATIVEDLL_API extern "C" __declspec(dllexport)<br />
#else<br />
#define NATIVEDLL_API __declspec(dllimport)<br />
#endif<br />
<br />
typedef void (CALLBACK *NATIVEWORKCOMPLETEPROC)();<br />
<br />
typedef BOOL (CALLBACK *NATIVEWORKCONTROLPROC)(LPARAM lParam);<br />
<br />
NATIVEDLL_API void StartNativeProcessing(NATIVEWORKCOMPLETEPROC workCompleteProc);<br />
<br />
NATIVEDLL_API void StartNativeProcessingWithControlProc(<br />
NATIVEWORKCONTROLPROC workControlProc, LPARAM lParam, NATIVEWORKCOMPLETEPROC workCompleteProc);<br />
<br />
#include "stdafx.h"<br />
#include "NativeDLL.h"<br />
#include <windows.h><br />
#include <commctrl.h><br />
<br />
BOOL APIENTRY DllMain( HANDLE hModule, <br />
DWORD ul_reason_for_call, <br />
LPVOID lpReserved<br />
)<br />
{<br />
switch (ul_reason_for_call)<br />
{<br />
case DLL_PROCESS_ATTACH:<br />
case DLL_THREAD_ATTACH:<br />
case DLL_THREAD_DETACH:<br />
case DLL_PROCESS_DETACH:<br />
break;<br />
}<br />
return TRUE;<br />
}<br />
<br />
NATIVEWORKCOMPLETEPROC g_workCompleteProc = NULL;<br />
NATIVEWORKCONTROLPROC g_workControlProc = NULL;<br />
<br />
const int workSleepTimeInMilliseconds = 1500;<br />
<br />
DWORD WINAPI ThreadFunc(void* pvThreadParam);<br />
void DoWork();<br />
<br />
NATIVEDLL_API void StartNativeProcessing(NATIVEWORKCOMPLETEPROC workCompleteProc)<br />
{<br />
g_workCompleteProc = workCompleteProc;<br />
g_workControlProc = NULL;<br />
<br />
DWORD dwThreadId;<br />
CreateThread(0, 0, ThreadFunc, NULL, 0, &dwThreadId); <br />
}<br />
<br />
NATIVEDLL_API void StartNativeProcessingWithControlProc(<br />
NATIVEWORKCONTROLPROC workControlProc, LPARAM lParam, NATIVEWORKCOMPLETEPROC workCompleteProc)<br />
{<br />
g_workCompleteProc = workCompleteProc;<br />
g_workControlProc = workControlProc;<br />
<br />
DWORD dwThreadId;<br />
CreateThread(0, 0, ThreadFunc, (void*)lParam, 0, &dwThreadId); <br />
}<br />
<br />
DWORD WINAPI ThreadFunc(void* pvThreadParam)<br />
{<br />
int loopControl = 0;<br />
<br />
do<br />
{<br />
DoWork();<br />
if (g_workControlProc != NULL)<br />
loopControl = g_workControlProc((LPARAM)pvThreadParam);<br />
}<br />
while(loopControl != 0);<br />
<br />
if (g_workCompleteProc != NULL)<br />
g_workCompleteProc();<br />
<br />
return 0;<br />
}<br />
<br />
void DoWork()<br />
{<br />
Sleep(workSleepTimeInMilliseconds);<br />
}
|
|
|
|
|
steve_rm wrote: #ifdef NATIVEDLL_EXPORTS
#define NATIVEDLL_API extern "C" __declspec(dllexport)
#else
#define NATIVEDLL_API __declspec(dllimport)
#endif
Why is export extern "C" but import not the same?
Regardless, the NATIVEDLL_API macro should be used only on the function declarations (prototypes),
not on the function definitions/implementations.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
have you #defined NATIVEDLL_EXPORTS anywhere?
|
|
|
|
|
Hello,
I got it working. However, I am not totally sure why.
Why did it work when I removed the NATIVEDLL_API from the function definitions, and what are the macros for?
Can you explain the code below?
Many thanks for you help,
Steve
<br />
#ifdef NATIVEDLL_EXPORTS<br />
#define NATIVEDLL_API extern "C" __declspec(dllexport)<br />
#else<br />
#define NATIVEDLL_API __declspec(dllimport)<br />
#endif
|
|
|
|
|
those let you create exports and imports from the same code base. when compiling the DLL, you use the export part, but when using the DLL, you use the import part.
it's standard DLL stuff that MS automatically creates for a DLL project.
|
|
|
|
|
I'm developing a game in win32 c++ DirectX.
On my graphic game window I have a picture of a 'close' button. When I click on it I want it to to the same as clicking the 'X' button.
But although I tried several things:
<br />
::SendMessage(hWnd, WM_CLOSE, NULL, NULL);
::SendMessage(hWnd, WM_DESTROY, NULL, NULL);
<br />
DestroyWindow(hWnd);
I get strange bugs that won't happen when I click 'X'.
|
|
|
|
|
PostMessage(WM_SYSCOMMAND,SC_CLOSE,0);
Best Wishes,
-David Delaune
|
|
|
|
|
Thank you very much.
It seems like all crazy bugs are gone.
|
|
|
|
|
Hanan888 wrote: ::SendMessage(hWnd, WM_DESTROY, NULL, NULL);
Don't do that! That doesn't destroy a window
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|