|
Imho, the most elegant way would be to package your data in an object that exists in your main window, and pass that object to the modal dialog.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
|
Hi,
Ive been learning how to use DirectInput for a small Win32 game Im making. Ive been looking at the article
http://www.gamedev.net/reference/articles/article607.asp
to get started.
I type in, as stated in the article, the function
DirectInputCreate. It looks like this:
DirectInputCreate(hInstance, DIRECTINPUT_VERSION, &lpdi, NULL);
Yet whenever I try to compile in C++ 6 I get the error:
'DirectInputCreate' : undeclared identifier
After searching the net I found the website:
http://www.mvps.org/directx/faq/directx_general_issues.htm#dinputcreate
It states:
"Compiling code for previous versions of DirectInput under DirectX 8, you must define a constant specifying the required version support prior to including dinput.h. Define DIRECTINPUT_VERSION to be equal to 0x300, 0x0500, or 0x0700"
I tried this and I get the same error message. This is really getting frustrating. Please help!
By the way I have definately included the DINPUT.H file.
Thanks for any help you can give!
|
|
|
|
|
this may not be the same thing, but in some Direct3D books I've read stuff in, it'll have the name as DirectInputCreate() when it's really something like DirectInputCreate8() (notice the '8'), or --9 or whatever version. I don't know if this is the problem but for whatever version of DirectX you're using, try looking up that same function name with a number appended to the end.
Other than that, the only other thing I can think of is that you didn't link one of the appropriate libraries. For your project properties, for additional include folders, specify the appropriate folder for your directx stuff, and move it to the top of the list. For additional library directories, do the same thing for your [directx path]/lib folder. Hope any of this helped
Who are all these people and what are they doing in my house?...Me in 30 years, inside a grocery store
My articles[^]
bdiamond
|
|
|
|
|
what version of DirectX are you using? I have 9 and I just looked in my help files for that function, and this is what I came up with: notice they have the '8' stuck in the middle of the function name.
<big>DirectInput8Create Function</big>--------------------------------------------------------------------------------
Creates a Microsoft® DirectInput® object and returns an IDirectInput8 or later interface.
Syntax
HRESULT WINAPI DirectInput8Create( HINSTANCE hinst,
DWORD dwVersion,
REFIID riidltf,
LPVOID *ppvOut,
LPUNKNOWN punkOuter
);
Parameters
Who are all these people and what are they doing in my house?...Me in 30 years, inside a grocery store
My articles[^]
bdiamond
|
|
|
|
|
I have it working! Im not sure what Ive done but my app compiled and worked.
I think I did the following:
#include <dinput.h>
#define DIRECTINPUT_VERSION 0x0700
rather than
#define DIRECTINPUT_VERSION 0x0700
#include <dinput.h>
DINPUT.H has its own DIRECTINPUT_VERSION defined and so I needed to define my own before I included the DINPUT.H file. Sorry for wasting your time on such a mistake.
As for the DirectInput8Create() function it seems that this is a improved function introduced in DirectX 8. This might explain why the other function doesnt work properly with DirectX 9. Thanks for bringing it to my attention. Im going to ditch the article I was using as it seems as though it was made for much older DirectX versions and research these new DirectX 8 functions.
Thanks for your help!
|
|
|
|
|
Trying to compose a MDI GUI like this, But still not yet figure out how to after a few days. Can anyone hlep? great thanks.
The GUI carries these features:
1. is a MDI.
2. a panel on the left side, which works like 'Search' panel in Win2K IE:
2-1. able to hide.
2-2. remain last setting and input when hide and re-show.
2-3. not float-able.
2-4. resizable.
First I tried to place a splitter into Client Window in MDI, but failed. Then I tried to use resizable controlbar, but can not satisfy requirement 2-3.
Any advices or ideas will be appreciated.
|
|
|
|
|
First I tried to place a splitter into Client Window in MDI,
why ?
I would do it with a dynamic splitter window, seems that it fits the required behaviour.
create a CSplitter, and put in either a formview or a child dialog.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Thank you, Maximilien.
Using MDI because that there will be many different child windows in the right side, and they will are abled to be organized in any layouts which users prefer.
So a splitter may not fit.
|
|
|
|
|
you want that window/pane attached to what ? the main frame or the MDI child windows ?
if it's the main frame, I think that using an undockable toolbar/dialogbar/sizablebar is the way to go, if the mdi child frame windows, I stand by the use of a splitter window.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
jpup wrote:
1. is a MDI.
This is one of the choices offered by AppWizard.
jpup wrote:
2. a panel on the left side, which works like 'Search' panel in Win2K IE:
You need to add a CSplitterWnd object to the CMDIChildWnd -derived class. Then override the OnCreateClient() member function. Call CreateStatic() from within OnCreateClient() . You might also need to make two calls to CreateView() .
jpup wrote:
2-2. remain last setting and input when hide and re-show.
Nothing special required for this.
jpup wrote:
2-3. not float-able.
Outside the context of a toolbar, I'm not sure what you mean by this.
jpup wrote:
2-4. resizable.
Nothing special required for this.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Thank you, DavidCrow.
Let me make it clear the requirement.
1. is a MDI: the 'panel' will locate in the left-hand side of the main window, while ClientWindow of MDI will locate in the right-hand side. Therefore, all child frame will be working in the left-hand side of the main window. So using splitter may not fit.
2-3 not float-able: because I try to use controlbar to build up the panel. but failed to make it un-float-able. Then I addd this item as a reference.
|
|
|
|
|
Hai,
I'm new to vc++ win32...i am trying to read and write to serial port COM1.
I know we can do this by createfile and read and writefile fns..but i am not sure about the flags and how to set buffer values..and what other funcs i need to do..suppose i want to write say "hello" to com1 and get the acknowledge "hi" from it...can any one help me with the code exactly how to do it..
thanks a lot.
|
|
|
|
|
I use external library to make my application in multilanguage.
So I need to change all texts in the interface.
But I have a problem with tooltip on toolbars.
Another way : Maybe there is a solution to change the value of the "string table" in my programm (I cannot create many "string table" because I use external library)
Hope someone can help me.
Regards,
Jérémy.
-------------------------------
Le sage cherche la Vérité,
L'imbécile l'a déjà trouvé.
|
|
|
|
|
Success trying to override CFrameWnd::OnTooltipText
with these messages in my CMainFrame :
ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTA, 0, 0xFFFF, OnTooltipText<br />
ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTW, 0, 0xFFFF, OnTooltipText
But I'm still interest if someone as any idea to change text of one "string table" in the program
Regards,
Jérémy.
-------------------------------
Le sage cherche la Vérité,
L'imbécile l'a déjà trouvé.
|
|
|
|
|
Hello everybody
see this:
CString myID;
myID="IDC_BUTTON1";
GetDlgItem(myID)->SetWindowText("");
any idea?
Best wishes.
Thanks
|
|
|
|
|
CString myID;
myID = _T("Any Text");
GetDlgItem(IDC_BUTTON1)->SetWindowText(myID);
P.
|
|
|
|
|
The problem you have is that GetDlgItem does not take a string as a parameter.
When you write
GetDlgItem(IDC_BUTTON1)->SetWindowtext("");
The compiler replaces the define IDC_BUTTON1 with its numeric value (see resource.h)
What would work is
int myID;
myID = IDC_BUTTON1;
GetDlgItem(myID)->SetWindowText("");
Unless I have misunderstood your problem.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
i am using installshield for microsoft vc++ 6.0 for my installation wizard.
I am unable to create a package, so that there will be a single setup.exe which can be used to install it.
Please let me know how to do this?
vidya
|
|
|
|
|
Hi
I dont have answer to your question you could use Install Shield forum for more help
http://community.installshield.com/[^]
Regards
The Best Relligion is Science.
Once you understand it, you will know God.
|
|
|
|
|
I have submitted the query in the install shield forum...
but no replies.....
creating a package in install express is easy.......
but i could do it in installshield for microsoft VC++6.0
Is there any script i need to write for that?
vidya
|
|
|
|
|
Just starting out,
Problem is that when I read a button name from a text file and
assign it using a control variable and the setwindowtext function, i seem to
get an extra character printed on the button.
I am using fgets to read a string from a text file.
Any help will be gratefully accepted.
Phil
|
|
|
|
|
It sounds like the string also contains the newline character.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
So whats the easy way to get rid of this?
|
|
|
|
|
Replace it with a '\0' character.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|