|
|
I had buy a Book Called "DirectX Effect".
I had read it,but I feel not enough.
Please Tell which book about DirectX3D is better.
I wish it will describe the detail about 3D Game Renader.
|
|
|
|
|
i recomand you OpenGL (NeHe's site, there i learnt a lot), but if you want to learn directX try the net, then buy books if you can't find what you want, usualy programing thechniques are found on the net too, game concepts are more dificult to find...
I hope you understand...
By the way... visit http://nehe.gamedev.net[^]
|
|
|
|
|
I have a List view ctrl. Now i could show the tooltip for each item. But the tooltip rect is too big and the text font is really ugly. I do not know where to set the tooltip's rect and text font, could any one help me?
Thanks a lot
|
|
|
|
|
Look at the articles in the ListCtrl/ListView section???
It's frustrating being a genius and living the life of a moron!!!
|
|
|
|
|
Here is a description of my problem. I have a modal dialogue window. In my OnInitDialog function, I may have to adjust the size of the window and it's contents manually because sometimes when the dialogue is constructed, an argument is passed into the constructor that turns off the display of certain controls within the window. So when the controls are off, I want to change the size of the window and remaining controls so that everything looks nicer (I don't want a huge blank spot in the middle of the window in this case).
So everything was working fine; I tried changing the window size of the dialogue and that worked fine. I know I can move buttons around and adjust them just like you do when a dialogue box is resizable by the user. But how do I resize a static group control? The group box is a border rectangle that surounds the controls and is just inside of the main dialogue. When I run the below bits of code, the GetClientRectangle function causes my system to crash. The group box is a CStatic control which inherits from CWnd. So it must have a rectangle, within the object, to describe it's coordinates. So why does GetClientRect fail? Is this not a valid function call for a CStatic control? If not, how do I get it's coordinates?
mGroupBox.GetClientRect(&myRect); //Crash!!!
//This would then adjust the height by 25%
mGroupBox.SetWindowPos(NULL, 0, 0, myRect.Width(),
(myRect.Height() - (myRect.Height()/4)),
SWP_NOMOVE | SWP_NOZORDER);
|
|
|
|
|
well.....
i dontsee anthing wrong.....
mGroupBox.GetClientRect(&myRect).....where mGroupBox happenz to be the CStatic Object
the "mGroupBox" IS A CWnd type and pointing to the static window(have u given the DDX control??).....once this is done.....use the SetWindowPos function(i have not used this,but i think maybe U HAVENT LINKED THE VARIABLE TO THE WINDOW USIND DDX maybe thatzthe prob).....
best of luck.....
happy programmin......
cheerz.....
|
|
|
|
|
The problem was that I was trying to implement the aforementioned code in my OnInitDialog method, prior to calling CDialog::OnInitDialog like so
BOOL UDxFilterDlg::OnInitDialog()
{
//NO! NO! Can't do this here. Must call
//CDialog::OnInitDialog(); first!
CRect rect;
mGroupBox.GetClientRect(&rect);
mGroupBox.SetWindowPos(NULL,
0,
0,
rect.Width(), (rect.Height() - (rect.Height()/3)),
SWP_NOMOVE | SWP_NOZORDER);
CDialog::OnInitDialog();
//Resize the group box below this point and it works fine!
//..rest of code
}
|
|
|
|
|
EMAIL s.w.kraft@netzero.net, WINXP Pro, MFC C++ 6.0
Supposedly one can pass arguments to a class by value or reference, no problem with value. However, code segment below:
//#include <iostream.h>
//Etc.
Workspace called "Cobject"
Create two classes:
Subobject1
Subobject2
Headers:
Subobject1.h
Subobject2.h
At initialize:
Subobject1 Initialize(float a, float b)
(results a,b defined)
Subobject2 Initialize(&a,&b)
(should pass a reference (address) to Subobject2, however,
get an error that says cannot convert float *a to float a
If I change Subobject2.h to Arguments &a, &b, still get error, not sure how to address the problem. According to
literature, should be able to pass arguments to a class
by reference without pointer logic, i.e. & arg to pass reference.
Would appreciate help on this one. Thanks in advance, Sid Kraft s.w.kraft@netzero.net;P
|
|
|
|
|
if I understand correctly, me think you put your & at the wrong place.
Initialize(&a,&b) ( if this is the call ), means you are passing the adress of A and B to Initialize, not the reference to a method which receive the parameters by value.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Your code is a little unclear. However, it seems that what you are trying to do is this.
For Subobject1
Declaration
void Initialize(float a, float b)
Call like
float a = 1.0;
float b = 2.0;
Initialize(a, b);
For Subobject2
Declaration
void Initialize(float& a, float& b)
Call like
float a = 0.0;
float b = 0.0;
Initialize(a, b);
i.e., for references you call the function in the same way. But if you change the values of a and b inside Initialize, they will have changed outside too.
Kevin
|
|
|
|
|
Hello everyone.
I am a very new member to this forum, and also very new to Windows programming.
I am challenging myself to building my own text editor. However, I don’t know where to start. So, I am looking for a source code for a simple text editor with functions like “Open, Save, Save As, Copy, Cut, Paste, About.” I don’t think any text editor in the world lacks these very basic functions. On that basic structure I plan to build and develop. I’d appreciate every bit of help in this matter because I am a very new programmer and I am barely scratching the surface.
I am not completely sure that I am even posting my request in the correct forum on this site, but I use Visual C++ 6.0 to do the little Windows Programming I know how to do. So, I figured I’d post my request here. I appreciate your kindness in advance
|
|
|
|
|
depends how deep you want to make your own text editor; do you want to handle everything ( drawing the words, handle keyboard event, ... ) or simply have a simple text editor.
for the former, I would consider learning a lot of C++/Win32/MFC programming before, it's a big task.
if it's the later, have a look at CRichEditCtrl which IS a MFC text editor control ( with basic functionality ); you simply create a MDI ( or SDI ) with a CRichEditView ( or something like that ) as the view type ( from the new project wizard ).
after that, you have to handle the save, load, ... fonts and color, and other stuff.
There are a lot of exmaple on this site, search for them.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
I would really suggest you read this entire tutorial:
http://winprog.org/tutorial/
But what you really need are these two pages:
http://winprog.org/tutorial/app_two.html
and
http://winprog.org/tutorial/app_three.html
wWw.KruncherInc.cOm
|
|
|
|
|
I would suggest looking at the articles at http://www.codeproject.com/editctrl/[^]
Start by hacking the windows edit control and getting a feel for how Windows implements an edit control.
Don't concern yourself with Open, Save, Save As commands as of yet...those are easy to add once you have an basic control built. Maybe not so much Copy, Paste, but i'd first get the caret moving about and inserting, deleteing characters down and bug free first.
Cheers
It's frustrating being a genius and living the life of a moron!!!
|
|
|
|
|
Has anyone used the MS ActiveX control - Record Navigation Control in an MFC app?
I like the look/functionality of the RecNavControl (like the record nav control in MS Access - VCR-type buttons), but I want to use this control not with an (imbedded) database, but just as a generic control.
I want to use this rec nav control to navigate a "linked-list" structure and display what current "link" i'm on, ability to jump to the "beginning of list", etc...
I'm having some problems with tying into the control as it just acts disabled and I can't do a "SetWindowText(szStr)" to fill the text window.
Any ideas? Any references out there? Thanks,
Johnny
|
|
|
|
|
Hi,
How would I supress a warning for a certain variable which I know is unused? On other compilers I can use something like #pragma unused (variableName).
Thanks
Hua-Ying
|
|
|
|
|
UNUSED(x);
UNUSED_ALWAYS(y);
UNREFERENCED_PARAMETER(z);
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Thanks!
UNREFERENCED_PARAMETER(z); worked for me.
Hua-Ying
|
|
|
|
|
Another approach is the following:
void function(type1 parm1,type2 )
{
} Commenting out the parameter name in the argument list guarentees that the parameter isn't used, since there is no longer a definition for it (the compiler will issue an error message otherwise).
Software Zen: delete this;
|
|
|
|
|
Hi,
Here is the scenerio.
sql server runs on computer myserver.
The application myapp (VC++ MFC) runs on another computer on LAN appComputer.
I need to restore the db mydb from myapp.
The back file is on appcomputer. So, when db tries to restore from thsi file it cannot access it cuz of security.
So i create a share in code myshare on teh folder containing the backupfile.
The Db still cannot access it.
But if I right click on teh folder and go to security taba nd add everyone to the list and provide full control to everyone it works fine.
Now am using sharing api fucntion netshareadd to add the share on the folder temporarily.
i went through the documentation of netshareadd but it does not provide any hints on how to add evryone to the security list in code.
sdoes anyone has idea how to do this??
thnaks in advance
|
|
|
|
|
Have you considered either the BACKUP DATABASE or SELECT INTO commands?
http://www.warriorforum.com/forum/topic.asp?TOPIC_ID=28236
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
well the database is already backup to a file. So backup datatbase is a no no.
Select Into returns one row of results, again unrelated to my problem.
What I want is to restore my database froma backup file on a remote machine on LAN.
This is doen by stored procedure using Restore Database blah from disk = path
now if path specifies a computer on LAn then it is like \\servername\drivename$\folder\file.dat
here SQL Server gives up since it does not have access to that drive.
So to provide access i create a temporary share on the said folder using sharing api function netshareadd.
It works fine but Server still cannot access cuz only certain people have rights.
So if i manually right click on the folder and go to security tab and add everyone to the list, SQL Server is happy, since it has access not.
The problem is how to do the same step in code.
Any suggestions???
|
|
|
|
|
So how about the RESTORE DATABASE command?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
That's exactly what doe snot work!
when a RESTORE DATABASE is given a path to file on remote computerr it fails because SQL Server does not have access to the folder!!!
|
|
|
|