|
Hi! I have a button with a bitmap on it. In Win98/2000, when I try to drag the button, the icon disappears and button becomes blank. It works fine in WinXP.
Any ideas why? Thanks!
|
|
|
|
|
I need to print barcodes using VC++ 2005 Pro on XP network laser printer. I have the barcode on the PC but need to download them to the printer. My program already calls win32 api function CreateFontIndirect(), but the barcode doesn't print, so I assume the font needs to be downloaded.
Thanks
|
|
|
|
|
you mean to tell me that nobody here knows how to do this I can't believe that nobody here has every had to download fonts to a printer. Unbelieveable.
|
|
|
|
|
nah. We've gone paperless - nobody prints anymore
You've created the font object but have you selected it into the printer DC before you render
what you're going to print?
Mark
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
Hi All,
WSAGetLastError returns a Error number, is there a way to get the actual error string instead of just the Error No. Eg 10054(Connection reset by peer).
If my program WSAGetLastError() returns 10054, I need to somehow get "Connection reset by peer" from the error code. Please let me know what function I need to use. Any help greatly appreciated.
Thanks
Turbo.
|
|
|
|
|
|
Note that for non-standard-Win32 error messages, you may need to tell FormatMessage(...) where to locate the message table for a particular error code.
[I do not remember if the Winsock errors are (or were) considered non-standard...]
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
TurboNext wrote: ...is there a way to get the actual error string instead of just the Error No. Eg 10054(Connection reset by peer).
Error Lookup tool.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
Hello everyone,
I get a strange compile error when compile such simple program. Any ideas?
foo.c: In function `main':
foo.c:5: error: storage size of 'var' isn't known
foo.c
<br />
#include "goo.h"<br />
<br />
int main (int argc, char** argv)<br />
{<br />
t_st var;<br />
var.member = 100;<br />
return 0;<br />
}<br />
goo.c
<br />
struct st {<br />
<br />
int member;<br />
<br />
};<br />
<br />
goo.h
<br />
typedef struct st t_st;<br />
thanks in advance,
George
|
|
|
|
|
My guess is that the compiler does not yet know what struct st is.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Move the declaration of st from goo.c to goo.h (before the typedef)
|
|
|
|
|
Nemanja Trifunovic wrote: Move the declaration of st from goo.c to goo.h (before the typedef)
I think if I define a struct in .c file, I can only use the struct in the same .c file, and have no walk-around to utilize the struct in other .c file.
If I want to use the struct in multiple .c files, I have to define it in .h file?
regards,
George
|
|
|
|
|
Why not just follow standard way to declare structures ?
In goo.h declare it like,
typedef struct st {
int member;
}t_st;
|
|
|
|
|
What makes "typedef struct {} name" better than just "struct name"?
Last I heard (a long time ago), using typedef for a struct like this is redundant.
I can see that it's cool to use one line to define the type and a variable, but using struct
like
struct name
{
};
defines a type so typedef is redundant (unless you want to define an alias).
I would say that this is the popular way, not the standard way.
Thanks,
Mark
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
Mark Salsbery wrote: What makes "typedef struct {} name" better than just "struct name"?
I believe typedef is required in C, and is optional in C++.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Ahh cool. Thanks!
Mark
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
DavidCrow wrote: I believe typedef is required in C, and is optional in C++
actually no. typedef is not required in C, but struct is.
that is, when you declare a structure and you want to declare a variable of that type, you must use the struct keyword :
<font color=blue>struct</font> TMyStruct {
<font color=green>
};
<font color=blue>struct</font> TMyStruct s1; <font color=green>
TMyStruct s2; <font color=green>
so, to get rid of that heavy notation, programmers used to typedef the structs/unions declarations :
<font color=blue>typedef struct</font> TMyStruct {
<font color=green>
} TMyStruct;
<font color=blue>struct</font> TMyStruct s1; <font color=green>
TMyStruct s2; <font color=green>
[Edit (for Mark)]
Note that such an expression :
typedef struct Name {} name; doesn't declare a variable of type name, but defines the synonym name for the type struct Name
to understand it, we can split it :
type definition
|
/------------\
<code>typedef struct Name {} name;</code>
\ /
\------------------/
|
typedef declaration
it's exactly like doing :
struct Name {};
typedef struct Name name;
Notice that a variable cannot be declared in a typedef instruction
[/edit]
|
|
|
|
|
toxcct wrote: actually no. typedef is not required in C, but struct is.
I knew it was something like that. Thanks for the clarification.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
5 for your effort & clarity!
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir?
Dr.Brad :Well,I just replied to everything Graus did and then argued with Negus for a bit.
|
|
|
|
|
Hi,
Do you mean the compiling issue I met with dealing with typedef? I do not think so.
BTW: your clarification is cool!
regards,
George
|
|
|
|
|
|
Thanks man!
Mark
now I worry about how much else I've forgotten over the years...
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
I prefer the definition without the typedef .
Steve
|
|
|
|
|
Why moving to .h will work? Could you explain from compiler/linker point of view?
What makes me confused is, why struct name/type is recognized, but its member is not recignized?
regards,
George
|
|
|
|