|
From the MSDN docs:
Requirements
Client: Requires Windows XP, Windows 2000 Professional, Windows Me, or Windows 98.
Server: Requires Windows Server 2003 or Windows 2000 Server.
Header: Declared in Setupapi.h.
Library: Use Setupapi.lib.
DLL: setupapi.dll
--
100% natural. No superstitious additives.
|
|
|
|
|
Hello,
I experienced a strange behaviour from the scanf function;
if i put the following code
char ch;
printf("stuff");
scanf("%c", &ch);
the program fills ch automatically and continues (skips input), anyone had the same problem ?
|
|
|
|
|
Deian wrote: the program fills ch automatically and continues (skips input), anyone had the same problem ?
Perhaps there is already something in the stdio stream that is being accepted by scanf() .
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I've read in many books and code snippets that you may use this pair printf/scanf, I tought that this is some kind of bug, I didn't want to use flush or similar function. Thanks for the reply.
|
|
|
|
|
It is working perfectly fine in Visual Studio 6.0.
Could you please give us some more details about Compiler, Operating System OR any information worth to repeat this problem?
|
|
|
|
|
Visual Studio 6.0 / SP5, Windows XP SP2
g++, FreeBSD 6.1
Devshed C++ / Windows XP SP2
I experience the same behaviour at all OS's and compilers.
|
|
|
|
|
I've checked it on RH linux too with gcc compiler.
Sorry sir, it's not repeatable. Could you please let me know some more details about the program?
One possibility is that, this is the part of your big program and something is already there in stdin stream.
Did you check the mentioned code as a separate program?
|
|
|
|
|
Yes, the fragment is part of a program, which uses scanf with %d, %s and %c, the problem of skipping the scanf function occurs only where the %c parameter is used. Why something is still staying in stdin ??
|
|
|
|
|
use sscanf
Please mail me
|
|
|
|
|
I have a class derived from CWnd (it looks like a label). I want to set the font but the following has no effect.I tried setting from within the class, and also externally (below). Neither matters.
LOGFONT lf;
memset(&lf, 0, sizeof(LOGFONT));
lf.lfHeight = 6;
strcpy(lf.lfFaceName, "Arial");
m_font.CreateFontIndirect(&lf);
m_grph.SetFont(&m_font);
sb
-- modified at 15:35 Wednesday 14th June, 2006
|
|
|
|
|
Does m_font belong to the CWnd -derived class? From where is SetFont() being called? There is an example in the Extras section of this article.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Can you try CreatePointFont??????
The procedure is like this.
// member
CFont m_FontArial;
// Create the font in Constructor
m_FontArial.CreatePointFont( 140, PSIGL_CONTROL_FONT_TYPE_ARIAL );
pWindow->SetFont( &m_FontArial );
yours faithfully
ajeeshcv
|
|
|
|
|
Here is what worked for me:
CClientDC dc(this);
CFont l_font;
l_font.CreateFont(14, 0, 0, 0, FW_NORMAL,
FALSE, FALSE, FALSE, 0, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_ROMAN, "Times New Roman");
CFont* l_old_font = dc.SelectObject(&l_font); dc.TextOut(50, 50, "Hello World");
dc.SelectObject(l_old_font);
l_font.DeleteObject();
except that I got my CDC in the OnraseBackground function of the CStatic class.
Thanks everyone for helping.
sb
|
|
|
|
|
im not sure your problem is this but m_font is global or no i saw if (m_font) isnt global it doesnt work i wrote a program and used like your code but font dosent change then i changed declare my variable from function to class and it worked.
whitesky
|
|
|
|
|
I am wondering if there is any standard convention or guideline to what function should call another. Suppose we have our main() function that will need to call functions setupCalculation() and calculate() in that order. Where should setupCalculation() be called from? Of course if we call it from main(), then we need to call it everytime we want to call calculate(). If we instead call it from calculate() then we may have to pass extra arguments to calculate() that setupCalculation() may require. So, does it come down to a case by case decision, or is there a standard way of going about this? Thanks for help!
|
|
|
|
|
Fame Ketover wrote: So, does it come down to a case by case decision, or is there a standard way of going about this?
No standard that I am aware of. You should strive for loose coupling, however.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
If you are making the nested calls ( i Mean calling function inside other function) it grows the stack.
if you call the function seperatly then they have same hiearchy in the stack.
Now efficient way to calling is depends on the Number of paramenters pass and type Vs. Function data.
If Your function work load is large which blocks the parent function in the stack.
For e.g.
void test()
{
while(1)
{
}
};
void mehere()
{
printf("Humm");
test();
};
Here the parent function completes its work but waiting for test() to complete because compiler pops the function data from the stack when it returns and control goes into the parent function.
The point is that you call the functions seperatly which are not related.
As well as it helps to use the stack efficiently for process.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Dear All,
I have alot of old functions that have 'FILE *' as a passing parameter.
Now I am using Compound File...It uses IStream (from IStorage).
Does anybody know how to convert IStream to FILE* ?
Thank's
|
|
|
|
|
Fwzklmn wrote: Does anybody know how to convert IStream to FILE* ?
In general you can't. An IStream is more abstract then a file: while some IStream implementations wrap files most will not.
Steve
|
|
|
|
|
you can use this(use from ISream only) (of course this is only a suggestion
<br />
IStream *m_StreamFile;<br />
SHCreateStreamOnFile(filename,STGM_READ,&m_StreamFile);<br />
whitesky
|
|
|
|
|
Read #1 and #9 here.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
This is in my homework.
Can you do it?
|
|
|
|
|
lulu0441 wrote: Can you do it?
While the odds are in my favor, why would I want to? How does me, or anyone else, doing your homework help you at all.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
erfy wrote: how i can create a database for my program?
Microsoft SQL, Access, MySql, Oracle? be specific.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|