|
Most printers can't print on the entire page. Lasers typically have a 'border' from 0.1 to 0.3 inches around the edge where they won't print. Ink jets are similar.
Software Zen: delete this;
|
|
|
|
|
I have a problem with this code, if anyone could please help me out, I would greatly appreciate it! I'm trying to make a program that has a certain number of 'char arrays.' When the program starts, it's supposed to randomly concatentate any of the two strings. My program has a problem in four lines of code, and I don't understand how to do it any different. Thank you for your time and help! (P.S., though this snippet of code only shows 4 different strings, my actual program will have at least 25);
//Test program. The object of this program is to
//have different strings randomly concatenate
#include <iostream>
#include <windows.h>
using namespace std; //or #include <stdio.h>, depending on the compiler
#include <string.h>
int main()
{
srand(GetTickCount());
char word[4][128]; //I want to store different strings into word[0], word[1], word[2], and word[3]
word[0][128] = "word1"; //This is set of four lines is where the problem is
word[1][128] = "word2";
word[2][128] = "word3";
word[3][128] = "word4"; //----end of the problem
int firstword;
int secondword;
firstword = rand() % 4;
secondword = rand() % 4;
strcat(word[firstword], word[secondword]);
cout << ""<< word[firstword] <<"";
cin.ignore();
return 0;
}
|
|
|
|
|
First problem: The line word[0][128] = "word1"; doesn't assign the string "word1" to word[0] , which is what I assume you want to do. These four lines probably shouldn't even compile, since on the left side of the assignment you are referencing a single character (word[0][128] ) and on the right side you have a string constant.
Second problem: You can't assign simple strings in the way you have. In C/C++, for simple strings, you use the strcpy() function.
Here's that part of the code, cleaned up:
strcpy(word[0],"word1");
strcpy(word[1],"word2");
strcpy(word[2],"word3");
strcpy(word[3],"word4");
Software Zen: delete this;
|
|
|
|
|
or try this
for(i=0;i<4;i++)
sprintf(word[i],"word%d",i);
Meinhard
|
|
|
|
|
Thank you so much everybody for your help! My program finally works thanks to your help!
|
|
|
|
|
You're welcome .
Software Zen: delete this;
|
|
|
|
|
|
I am "drawing" shapes in the user area of display and want to erase all that I drew to-date. I set the variable ShapeKind to the type of curve, i.e. bezel, points or, if points, I set them all to zero and then issue "Invalidate". This erases the screen of any lines that I have drawn to-date. However, I was told to set ShapeKind but do not know how it is used or called within the "Invalidate" statement, any comments to Sid Kraft at sid_kraft@msn.com. Thanks
Sid
|
|
|
|
|
Hi to you,
sorry about me very bad english. I'm looking for a way to include a html-based resource in a project and diplay it as an modless Window.
Can somebody help?
Meinhard
|
|
|
|
|
use below in your .rc file:
TESTID RCDATA "htmlfile.html"
and use it in your code. m_hInstance can be NULL.
HRSRC h = FindResource(m_hInstance, "TESTID", RT_RCDATA);
if (!h)
{
HGLOBAL f = LoadResource(m_hInstance, h);
void* mem = LockResource(f);
int size = SizeofResource(m_hInstance, h);
}
and cook it.
Enjoy
Anderson Sheen (exteide@gmail.com)
The Extension IDE: http://www.exteide.com
|
|
|
|
|
Thank you very much!!
I tried it and it works fine! But as a stupid I am, my question now is, how to put it on the sreen in a window?
Thank you for helping again.
Meinhard
|
|
|
|
|
|
Thank you for your answer. But the difficulties never ends. The linked sample is written for Vers 8.0. I'm unable to use, because I#m only owner of the 7.0 Version of VS.
Hope you would help me again.
All the best
Meinhard
|
|
|
|
|
|
thanks for all, it works fine !!
|
|
|
|
|
I have written a simple audio player that uses MCI to audition audio files from a Windows file dialog, as well as from our own graphic UI.
Unfortunately, since writing it we have learned that MCI does not support several audio file types, notably 24-bit files.
We'd like to rewrite the class to use WMP, but documentation for that technology is hard to find.
Can anyone recommend a way to use WMP to implement the following interface?
class AudioPlayer
{
public:
AudioPlayer();
~AudioPlayer();
void OpenFile(const tstring& strFileName);
void CloseFile();
const tstring& GetFileName() const;
void Play();
void Stop();
bool IsPlaying() const;
bool CanPlay() const;
};
|
|
|
|
|
|
Hello programmer's
I need to help
How to change MCI_DGV_SETVIDEO_BRIGHTNESS in the MCI_SETVIDEO
I Can't use this parameter it's not response to Value
Thanks for answer
|
|
|
|
|
Hi...
I'm an administrator in a big network,
i Have made a small app in vb that manages the ip address in the network (it gives u free ip by selecting the desired segment, show reports and etc...)
i wanna integrate this app into active directory so when someone adding new computer he can also get a new ip quickly for this computer.
is there any way that i can add a menu into the menu bar in "active directory users and desktops"?
or if any1 have other idea how i can integrate this app into active directory.
thanks a lot
and sorry about my crappy english.
|
|
|
|
|
|
no...
i wrote a program in vb.
now i want to integrate this program into a compiled exe.
let's say i wanna add a new menu to notepad.exe menu bar.
is this possible?
|
|
|
|
|
Hello guys,
Consider I have some text data(maybe a Microsoft Access database *.mdb file
too), and I want to save them as Microsoft Excel file.
How can I achieve that ?
thanks.
PS. I have MFC Dialog based Application
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
-- modified at 9:25 Saturday 4th February, 2006
|
|
|
|
|
I haven't actually tried this, but you might be able use Microsoft's ODBC driver for Excel[^].
Steve
|
|
|
|
|
You might want to save the data in Comma Separated Variable (csv) format. Excel can open csv format files directly. For instance:
int value1 = 20;
int value2 = 32;
float value3 = 10.3f;
FILE* myFile;
myFile = fopen("c:\\temp\\foo.csv", "wt");
if(myFile)
{
fprintf(myFile, "%d, %d, %.1f\n", value1, value2, value3);
}
fclose(myFile);
Graham
|
|
|
|
|
thanks Graham.
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
|
|
|
|