|
This makes no since! You wrote a program (dialog based) that interpits joystick messages.
sweep123 wrote:
What I dont want is to have to include this dialog into any applications that require Joystick data.
Well, do not include it; the dialog application was a test! Now you can write the real application knowing that you do receive the messages and can act accordingly.
INTP
|
|
|
|
|
What I was trying to obtain, is it possible to wrap up this dialog based MFC application into a DLL so that any other programs that require Joystick input could use this DLL.
Now if any applications have problems during debugging you could call upon the facilities of the Joystick DLL to aid testing. i.e. display the dialog and view the Joystick data and status info.
Also would it be possible for a Console based application to use this DLL (which contains a dialog and message maps etc).
Yes I could use the code by inserting it into each project, but just wanted to re-use in the simplest way possible the code already generated.
Does that make more sence?
|
|
|
|
|
Ok! Break the code down! One message per function (like MFC does)! You need to seperate the code that displays the messages from the code that interprets the messages.
If you want to give (your DLL) the ability to show the last message received, then you will have to provided some storage space (i.e. variables) to hold the last message received.
The dialogbox is irrelivant, the information is what matters. Seperate the information functions (totaly) from the interface. Then the information can be retrieved, regardless of what interface is used to display it.
INTP
|
|
|
|
|
I think my real question is can I just build my MFC application as a DLL where I export several functions that provide Joystick data/status. Yes seperate the code that displays from the code that manages the data.
But when I load this DLL, will the dialog be displayed? I was thinking of having a hide/show function exported via the DLL.
What confuses me is that fact that as I dont want to use DirectX for Joystick control, just want to use the Joystick messages, but does that mean I need to have a dialog etc to run this scheme?
Or can I still use the Joystick messages in the DLL without creating an MFC type program with dialogs etc.
|
|
|
|
|
The dialog should be just another function that you call. In order for it to display the infomation it has to call the same functions that an external program would have to call. If the data source is seperated from the code that displays the data, then anybody can access the data. For example document->view; the document is the data the view is the display. You could have one view show the data as a line graph and another as a bar graph, they all are getting the data from the same source.
As to whether you can bypass DirectX for Joystick control messages, I do not know. I suspect you cann't.
sweep123 wrote:
But when I load this DLL, will the dialog be displayed?
No!
sweep123 wrote:
can I still use the Joystick messages in the DLL without creating an MFC type program with dialogs etc.
Yes!
MFC is just a frame work provided by Microsoft. It is not the key to writing Windows programs, the key is the Windows SDK which was written in C. MFC just make it easier to write programs for Windows. Try to write your code as MFC independent as possible, use MFC mainly for the interface.
INTP
|
|
|
|
|
Thanks for your input.
I think I will re-write the code as a DLL, lifting as mush as possible from the MFC application.
May even post it if it all works OK.
Thanks again.
|
|
|
|
|
when i run vcvars32.bat i get the following message: out of environment space.
when i try to run the command: namke /f makefile.w32 zlib.dll i get a fatal error: V1073: don't know how to make adler32.c.
this code is taken from codeguru->visual c->misclaneous->miscellaneous->MAPI->send as zip.I need this code for my progrm.
|
|
|
|
|
Filomela wrote:
when i run vcvars32.bat i get the following message: out of environment space.
I've not seen this problem since DOS and Windows 3.1 were the norm. What OS are you using? Read MSDN articles Q248802 and Q230205 for starters.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
|
Yesterday I asked in this forum about a problem:
I could never get the PreTranslateMessage in my dialogs.
I found a solution:
for my current project I use MFC in a dll (staticaly linked).
I had to give an interface to the application that starts the dll an overide the PreTranslateMessage function of the application to call the interface function that activates the PreTranslateMessage mechanism.
Aviv.
|
|
|
|
|
I was not here yesterday; but in general, you do not want to staticaly link to the MFC DLL (mass overhead). I have more than one class that overides the PreTranslateMessage function and none of them required that MFC be staticaly linked. For that matter PreTranslateMessage was disigned to be overriden, that is, it is a member of the CWnd class which is the base of all window based objects.
INTP
|
|
|
|
|
Linking the dll dinamicaly to MFC would not solve the problem.
(I checked out the microsoft sight about this. Look at the DLLScreenCap Sample at this URL :
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcsample/html/vcsamDllScreenCapSample.asp
)
The problem with the PreTranslateMessage is, that it was not passed through to the dll automaticaly, but needs to be done manualy.
avivhal
|
|
|
|
|
If it does not work staticaly it will not work dinamicaly linked either.
All I know is that all the windows(/classes) derived from CWnd receive messages via PreTranslateMessage (this is a given).
I do not know about this manualy stuff, I've never had to do that for PreTranslateMessage. I go to the ClasssWizard and select PreTranslateMessage and it generates the code, that works.
INTP
|
|
|
|
|
CAn i send data to USB port as there is a way to COM Port
if yes then plz send me help or sample code
thanx
|
|
|
|
|
Yes!
Sorry no code!
From a programming aspect a USB port is the same as a serial port (aka. COM Port). If you are talking about drivers, then we are on a totaly different subject.
INTP
|
|
|
|
|
You write to a COM port as you do to a file. I expect that you do the same with USB ports.
NOTE: You will probably need appropriate USB drivers to do this.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fuity and sweet. I'm jelly, what am I? - David Williams (Little Britain)
|
|
|
|
|
|
Ooops! I stand corrected. Perhaps I shouldn't have posted a presumption!
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fuity and sweet. I'm jelly, what am I? - David Williams (Little Britain)
|
|
|
|
|
Hi..All..
How are you?
Well,hope you are fine..
Today,I when I try to use 24-bit bitmap in toolbar(vc++6.0) then get shock that it is not supporting 24-bit image in toolbar. You are mastermind & I'm sure you must have any idea to place that bitmap on toolbar.
Please, Tell me, How can I do this.
I'm sure you will help me.
Thanks
OK! Good Bye..Have a Nice Life..Bye
---Sumit Kapoor---
|
|
|
|
|
I find you intertaining!
Take a look at some of the articles at codeproject, regarding toolbars.
Note: Do not use the bitmap editor included with VC++ 6.0 to modify bitmaps of more thatn 16 colors. If you open it with that editor it will convert it and make your life difficult.
INTP
|
|
|
|
|
hem, VC++, only 16 colors ?!
mine can edit 256 colors bitmaps without convert it back into 16 colors.
TOXCCT >>> GEII power
|
|
|
|
|
hi every body ,
can any body help me in solving the problem .
first i dont know vc++ perfectly
"how can i let the user to edit text in the flex grid control"
|
|
|
|
|
Use CEdit Control, Dynamically move CEdit control to the active grid cell, resize its dimension according to cell size, the parent of CEdit control should be Grid contol
|
|
|
|
|
|
hi
i guess this follows on from my earlier Question.
What mechanisms are there for detecting the insertion of an SD card into a PC or Laptop (not PPC)
The autoplay stuff seems to be ok but the problem is getting information as to where the card is (which drive etc) is a problem
Oh i guess i also need to fire up my application when the card is inserted, if the app is not already running
cheers and thanks
bryce
---
Publitor, making Pubmed easy.
http://www.sohocode.com/publitor
|
|
|
|