|
Hi!
I have made a very simple program that:
-Create a main window getting screensize (es 1600x1200 or 3200x1200 if I have 2 monitor)
-Initialize DirectX (Direct3DCreate9())
-Create a Device (CreateDEvice())
-Create a Texture (D3dXCreateTextureFromResourceEx())
-Draw and move this texture.
My problems is that with this conficuration:
-2 monitor side by side
-Both resolution are 1600x1200
-First monitor have coordinate 0,0
-Second monitor have coordinate 1600,0
In the second monitor I have a dead zone (vertical black band) where nothing are draw. This band is approximately 200x1200 with coordinate 3000,0
If I use the same configuration but with a smaller resolution es 1200x1024 in both monitor the program works fine.
Why? Where is my mystake? Some idea?
Thanks.
|
|
|
|
|
So this is the last loop I need for my project.
I need to open the file LIBRARIANSHAVE347CATS.DAT and send the info to the screen. Then, it has to search through all entered data, and create a new output file called "bigbook.dat" in which all entered books of over 200 pages have all their data sent to the new file.
So far this is what I have:
struct card_catalogue
{
float dewey;<br />
string title;<br />
string author;<br />
int released;<br />
int num_pages;<br />
enum typeofbook {fiction = 1, nonfiction, reference, pond};<br />
};<br />
<br />
int main()<br />
{ <br />
card_catalogue books;<br />
ofstream outfile;<br />
int i; <br />
<br />
<br />
cout<< "Enter the Dewey Decimal Number please: ";<br />
cin>> books.dewey;<br />
cout<< "Enter the Title of the book please: ";<br />
getline(cin, books.title);<br />
cin.ignore(80, '\n');<br />
cout<< "Enter the Author of the book please: ";<br />
getline(cin, books.author);<br />
cout<< "Enter the Year of Release please: ";<br />
cin>> books.released;<br />
cout<< "Enter the Number of Pages please: ";<br />
cin>> books.num_pages;<br />
cout<< "<-----Type----->"<<endl; <br />
cout<<"1 - Fiction" <<endl<br />
<<"2 - Non-Fiction" <<endl<br />
<<"3 - Reference" <<endl<br />
<<"4 - pond"<< endl;<br />
cout << "Enter the type: ";<br />
cin >> i;<br />
<br />
if(i == 1)<br />
{<br />
cout << "You chose Fiction\n";<br />
}<br />
if(i == 2)<br />
{<br />
cout << "You chose Non-Ficiton\n";<br />
}<br />
if(i == 3)<br />
{<br />
cout << "You chose Reference\n";<br />
}<br />
if(i == 4)<br />
{<br />
cout << "You chose Pond\n";<br />
} <br />
<br />
outfile.open("LIBRARIANSHAVE347CATS.DAT",ios::app);<br />
<br />
if(outfile)<br />
{<br />
outfile << books.dewey;<br />
outfile << books.title << endl;<br />
outfile << books.author << endl;<br />
outfile << books.released << endl;<br />
outfile << books.num_pages << endl;<br />
outfile << i << endl <<endl;<br />
<br />
}<br />
else<br />
{<br />
cout << "An error occurred while opening the file. \n";<br />
}<br />
outfile.close();<br />
return 0;<br />
}
|
|
|
|
|
That looks great, let us know how your project turns out.
|
|
|
|
|
klutez123 wrote: I need to open the file LIBRARIANSHAVE347CATS.DAT and send the info to the screen.
So why are you opening the file and writing to it? Does that not seem the least bit odd to you?
klutez123 wrote: So far this is what I have:
The code you've shown addresses almost none of your requirements. It allows you to enter data for a single book. You either need to create an array of card_catalogue objects and write out the array after the loop terminates, or you'll need to write out the data in books each iteration of the loop. Where's the loop?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Ever heard of indentation? I don’t even look at posts in which the poster doesn’t make the effort to indent the code.
Steve
|
|
|
|
|
What does "indent" mean? (I'm spanish :P)
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
Nelek wrote: What does "indent" mean? (I'm spanish)
In short it means you write this:
for( ;; )
{
}
instead of this:
for( ;; )
{
}
Steve
|
|
|
|
|
Ok, then it is to use the tabulated structure, isn't it? Thanks for the answer
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
Hi,
Is there any API through which i can find the IP address of current computer(computer on which my exe is running).
Warm Regards,
Mushq
|
|
|
|
|
How about gethostbyname() ?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
|
Hello All,
I am working a addin for MS Word and i am new with that so i have registered a addin but now i am unable unregistered this addin.
so can body tell me how can i unregistered a addin.
and also i want to know how can i add menu bar in this addin and how to handle messages?
if any body can give me idea about that, than please share with me.
thanks
bankey
|
|
|
|
|
Banks K wrote: so can body tell me how can i unregistered a addin.
How did you register it?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I have registered with "regsvr32 *.DLL"
|
|
|
|
|
So why can't you just use the /u command-line switch?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
So how about "regsvr32 -u *.DLL"?
Regards,
Tim
|
|
|
|
|
Hi fellows
I need to insert an image in my menu. My menu is composed with the following strings: "New Text", "New File", "New Ruler".
My menu was coded with win32, not MFC.
Now the questions:
1) I've readed that I need to create owner draw menus. Is that right?
2) How can I load an image to insert in my menu? The size of the image matters or when I insert, windows fit the image according the area that I passed.
3) What you recommend that I read to get a better understand of this topic and start coding?
Any help is very welcomed. Again thanks for the support.
|
|
|
|
|
I've used NewMenu in several projects. Excellent.
|
|
|
|
|
|
thanks man, I'll see right now...
|
|
|
|
|
I hope it solved your problem.
|
|
|
|
|
Thanks man, for your help
|
|
|
|
|
|
Hi Alex,
Since you have asked specifically for win32, I thought I should let you know the precisely steps to create Menu and answer your questions.
1) I've readed that I need to create owner draw menus. Is that right?
Its not mandatory.
2) How can I load an image to insert in my menu? The size of the image matters or when I insert, windows fit the image according the area that I passed.
Windos fits the image accordingly. If you want text with a bmp as a menu item then again the space will be fixed for the bmp.
Steps:
HMENU Menu;
Menu = CreatePopupMenu();
HBITMAP hBitmap1 = LoadBitmap(AfxGetInstanceHandle(),MAKEINTRESOURCE(IDB_BITMAP1));
HBITMAP hBitmap2 = LoadBitmap(AfxGetInstanceHandle(),MAKEINTRESOURCE(IDB_BITMAP2));
//Append
AppendMenu(Menu, MF_STRING, 2000, "Test3333333333");
AppendMenu(Menu, MF_SEPARATOR, NULL, "");
AppendMenu(Menu, MF_STRING, 2001, "Test2");
SetMenuItemBitmaps(Menu, 2001, MF_BYCOMMAND,hBitmap2, hBitmap1);
TrackPopupMenu(Menu,TPM_RIGHTALIGN,point.x, point.y,0,this->m_hWnd,NULL);
The above steps will create 2 Menu items, one only text and other bmp with text.
Manoj
Never Gives up
|
|
|
|