473,839 Members | 1,408 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why is it dangerous?

'evening.

I'm not new to C and have been programming in it since I was 8 but
here's a strange problem I've never seen before.

When I compile a program from our C course with a windows compiler
there is no problem but when I try to compile it with a linux compiler
it complains that

a_03.c:(.text+0 x4d): warning: the `gets' function is dangerous
and should not be used.

Is linux more dangerous than windows? Where can I download a
non dangerous gets function? I have never used gets before is
there undefined behavior somewhere?
Here is a trimmed down example program from my assignment that
demonstrates the problem

#include <stdio.h>
#include <malloc.h>

void main()
{
char *string;
printf("enter string (max 2000 chars): ");
fflush(stdin);
fflush(stdout);
string = (char *)malloc(2001);
if(!string) exit(1);
gets(string);
printf("you entered: %s\n", string);
free(string);
exit(0);
}

On windows with TurboC and Lcc no error is printed. On linux with
gcc it says gets is dangerous.

Please advise my instructor says gcc is overly pedantic.
Aug 10 '08
233 8777
Malcolm McLean wrote:
>
"Ben Bacarisse" <be********@bsb .me.ukwrote in message news:
>"Malcolm McLean" <re*******@btin ternet.comwrite s:
>>"Gordon Burditt" <go***********@ burditt.orgwrot e in message
There is no non-dangerous gets() function with the same interface.
The non-dangerous function is called fgets().

This is a hardy annual.
Of course fgets() can be used safely, but won't be. For instance
Richard Heathfield posted a dangerous use of fgets() in this very
thread. It will give the wrong answer if the user enters a string of
over 2000 characters.

You have allowed yourself to slip into polemic. It is not clear, at
least to me, what the right answer is so you are stretching the point
-- be careful with fgets and long lines -- by saying that the answer
is "wrong" and the use "dangerous" .
if I enter

"My name is Rumplewumple ... stiltskin"
and the program comes back

"You entered My name is Rumplewumple ... stilt"

Then I might well object that that's my cousin. Which is potentially
dangerous, depending on what the program is being used for.
If the integrity of your data is valuable, you have to program
carefully. Simple isn't it. In such situations using fgets()
simplistically is not good enough, but it's still *better* than gets.
It's a question of getting data a little wrong or overrunning buffers
with *any* consequences from an immediate crash (lucky you) to altering
valuable data elsewhere.

There is no debate whether gets or fgets is safer. The latter is
*always* the safer option. If you want a line getting function with the
interface of gets, then it's easy enough to write your own.

Aug 10 '08 #31
CBFalconer <cb********@yah oo.comwrites:
santosh wrote:
>Harald van D?k wrote:
>>santosh wrote:
CBFalconer wrote:

Correctio n: That omits many useful tests. I suggest:
>
gcc -W -Wall -ansi -pedantic
>
for better error detection.

I would also recommend:
[...]
-Wwrite-strings

I would not, since it deliberately makes the compiler nonconforming.
For those that understand in what ways, it can be useful, but they
can find the option themselves. CBFalconer included that option in
his recommendations recently, and I'm glad he dropped it.

Thanks for that. I do remember that subthread now, but I passed over
it, being pressed for time. Now, to the Google Groups archive...

I didn't drop it. I conceded your 'non-standard' point. I
maintain that, for new code, including it will result in better
code, and maintain conformity. It may object to some actually
conforming code.
So it seems you did not accept *my* point of a program that requires a
diagnostic which -Wwrite-strings suppresses.

--
Ben.
Aug 10 '08 #32
Malcolm McLean wrote:
"Ben Bacarisse" <be********@bsb .me.ukwrote in message news:
.... snip ...
>>
You have allowed yourself to slip into polemic. It is not clear,
at least to me, what the right answer is so you are stretching
the point -- be careful with fgets and long lines -- by saying
that the answer is "wrong" and the use "dangerous" .

if I enter
"My name is Rumplewumple ... stiltskin"
and the program comes back
"You entered My name is Rumplewumple ... stilt"

Then I might well object that that's my cousin. Which is potentially
dangerous, depending on what the program is being used for.
If that happens you have made an error in writing the program. It
is simple to avoid any such result while using fgets.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home .att.net>
Try the download section.
Aug 10 '08 #33
In article <3a************ *************** *****@4ax.com>, Barry Schwarz <sc******@dqel. comwrote:
>On Sun, 10 Aug 2008 09:27:13 +0100, "Malcolm McLean"
<re*******@bti nternet.comwrot e:
>>
"Gordon Burditt" <go***********@ burditt.orgwrot e in message
>>There is no non-dangerous gets() function with the same interface.
The non-dangerous function is called fgets().
This is a hardy annual.
Of course fgets() can be used safely, but won't be. For instance Richard
Heathfield posted a dangerous use of fgets() in this very thread. It will
give the wrong answer if the user enters a string of over 2000 characters.

Any code that does not check the status of "service requests" is
dangerous. But this is a result of sloppy programming. It is not an
inherent property of the request itself as a call to gets() is.
Since gets() returns the same indication both when the input overflows the
buffer allocated for it, and when it doesn't -- thus necessarily precluding
the possibility of any such status check -- it could be argued that the use of
gets() constitutes "sloppy programming" in and of itself.
>
>>Of course it is not dangerous in a little exercise program that doesn't do
anything, but then neither is gets().

I guess on your system undefined behavior can never do any harm.
>>
To use fgets() safely you must check for the newline. If it is not present a
buffer overflow occurred. So you must then take action against the buffer to

Actually, a buffer overflow was prevented.
>>ensure that the next read doesn't get the remainder of the previous line.

The recommended action should be either:

Whatever the program needs to do to obtain the remainder of
the line so the input can be processed as intended .

Reject the input with appropriate notification to the user and
suitable follow-on action
Exactly so.
Aug 10 '08 #34
Ben Bacarisse wrote:
CBFalconer <cb********@yah oo.comwrites:
.... snip ...
>
>I didn't drop it. I conceded your 'non-standard' point. I
maintain that, for new code, including it will result in better
code, and maintain conformity. It may object to some actually
conforming code.

So it seems you did not accept *my* point of a program that
requires a diagnostic which -Wwrite-strings suppresses.
No. I consider the chance of a complex program trying to write to
a non-writable string is more likely than the case you brought up
(which I have absent-mindedly forgotten). And, if I need it, I am
quite capable of remove -Wwrite-strings from the command for a
particular compilation.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home .att.net>
Try the download section.

Aug 11 '08 #35
CBFalconer <cb********@yah oo.comwrites:
Ben Bacarisse wrote:
>CBFalconer <cb********@yah oo.comwrites:
... snip ...
>>
>>I didn't drop it. I conceded your 'non-standard' point. I
maintain that, for new code, including it will result in better
code, and maintain conformity. It may object to some actually
conforming code.

So it seems you did not accept *my* point of a program that
requires a diagnostic which -Wwrite-strings suppresses.

No. I consider the chance of a complex program trying to write to
a non-writable string is more likely than the case you brought up
(which I have absent-mindedly forgotten). And, if I need it, I am
quite capable of remove -Wwrite-strings from the command for a
particular compilation.
I think we have crossed wires. I use that option. I think it useful
and I know you can remove it when you need to (as I can). It is just
that you seemed to be suggesting that it did not break conformity,
only that it objected to some conforming code. People (particularly
learners) should know that it silently allows some programs though
that should have a constraint diagnosed.

--
Ben.
Aug 11 '08 #36
santosh wrote:
Antoninus Twink wrote:
>santosh wrote:
>>CBFalconer wrote:

Correction : That omits many useful tests. I suggest:
gcc -W -Wall -ansi -pedantic
for better error detection.

I would also recommend:
[...]
-Wpointer-arith

This is redundant, since it's already enabled by -pedantic.

This is not mentioned in my gcc documentation. Looking it up on the
Web... yes I see you're right. Must have been added recently.
I am running gcc 3.2.1, dated 2002, and that option is available.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home .att.net>
Try the download section.
Aug 11 '08 #37
CBFalconer <cb********@yah oo.comwrites:
santosh wrote:
>Antoninus Twink wrote:
>>santosh wrote:
CBFalconer wrote:

Correctio n: That omits many useful tests. I suggest:
gcc -W -Wall -ansi -pedantic
for better error detection.

I would also recommend:
[...]
-Wpointer-arith

This is redundant, since it's already enabled by -pedantic.

This is not mentioned in my gcc documentation. Looking it up on the
Web... yes I see you're right. Must have been added recently.

I am running gcc 3.2.1, dated 2002, and that option is available.
The question wasn't whether it's available, it was whether
"-Wpointer-arith" is enabled by "-pedantic".

In any case, it would be a good question for gnu.gcc.help.

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Aug 11 '08 #38
On Aug 10, 6:25*pm, Antoninus Twink <nos...@nospam. invalidwrote:
a_03.c:(.text+0 x4d): warning: the `gets' function is dangerous
and should [never] be used.
...
Of course, this is nonsense. There is a perfectly safe way to use
gets(), namely by being in control of what appears on stdin.
Heresy! I'm surprised no one launched a diatribe here
against Mr. Twink, so let me offer a diatribe in support!
Six comments on gets().
First, some history. (Some c.l.c'ers weren't
even alive at the time of the infamous Internet
Worm.)

The infamous worm was complex enough to attempt
exploitation of at least 4 different security loopholes,
but just one of the loopholes was ubiquitous enough
to make it necessary and sufficient for the Worm's
"success." That loophole was the dangerous use
of gets() in a program (fingerd) usually run with
superuser authority. It was the exploits of the
Internet Worm that led to the deprecations against
gets(). (The exploiter, IIRC, wasn't a larcenous
"black hat", but rather a "gray hat" who deliberately
aroused the Unix community from its apathy about
such bugs.)

The fingerd->gets() exploit was not trivial.
The overrun buffer was an automatic variable just
below a procedure frame, whose return-address was
modified to point to executable code within the overrun
buffer. That code loaded and ran another program
(misnamed 'sh' or 'csh') which, among other things,
executed the 'fake finger' program to exploit the
fingerd->gets() bug on still other machines.

The detailed steps of this exploit get elided in the
retelling, and programmers are left with the take-home
lesson: use gets() and the Russian mob will take
over your machine and the rest of the world.
One doesn't have to be a gets() enthusiast to note
fingerd's special nature, and that the claim that
all gets() usage risks catastrophe is confused.
Second, a confession.

Whenever I build the Index to the Fabulous Pedigree
http://fabpedigree.com/altix.htm
I do several hundred thousand gets()'s, but none of
them are "dangerous" . I live with a few "dangerous"
messages during the build (although I'm sure the pedants
would prefer that each of the several hundred thousand
gets()'s produced its own such message. :-)
Perhaps there's a way to disable gcc's "dangerous"
message but, in keeping with the FSF philosophy, I'm
sure the cure is worse than the disease, something like
setenv IM_AN_UNREPENTA NT_MORONIC_ASSH OLE
Third, a boast:

Since another of my "eccentric" codings, in private
throw-away code, is to *not* test malloc()'s return for
zero (failure leads to a core dump, which is what I want
anyway(*)), I'm sure that many in this ng believe that
James Dow Allen's code is buggy! I do not believe
this is the case. When I was rehired after a year to
add new support to a complete OS I wrote as a contractor
I was pleased to note that no changes had been found
necessary to my delivered code. Code reliability
doesn't require ingenuity (indeed the two may be
inversely related!); it requires conscientiousne ss
and avoiding the cheap substitution of dogma for thought.

AFAIK, I've never used gets() in code I've delivered
to a customer. (This is partly because most of my delivered
code has been OS or standalone, with any stdio library
calls unavailable.) I do use gets() sometimes, on
private code, when the gets()'ed string was itself
machine-produced. The gets() buffer is usually at least
ten times as large as the longest machine-produced
string. The executables are protected from the
Internet by an Impenetrable Firewall. If someone does
break into my house, intending computer mischief,
I'd be surprised if his mischief needed to invoke gets().

The gets() deprecators aren't wrong; indeed I'll cheerfully
concede that their position is more defensible than mine!
But I'm happy to take a Devil's Advocate position to
encourage critical thinking when I see the preposterous and
dogmatic over-generalizations which become so routine in
this ng. Is gets() a *potential* source of bugs? Obviously.
But I'd love to organize a wager, between me and one of
the pedants, on whose code contains more *actual* bugs.

* - Detractors will argue that what I *should* want to
do is spend hours writing a diagnostic for such malloc()
failures! In fact I don't want to do anything about them
since the smallish malloc()'s I use to build the website
Aren't Going To Fail(tm). (The pedants will respond to
this with some nonsense about how the website building
may be ported, some day, to the limited-memory chip
inside my car's fuel injection system !)
Fourth, a peeve:

fgets() preserves LineFeeds, gets() discards them.
Either behavior is fine (an application whose
stringency requires special treatment of an
"unterminat ed last line" probably will avoid
fgets() for other reasons anyway), but similarly-named
functions *SHOULD BEHAVE SIMILARLY*.
Assuming gets() came first and it was too late to
redefine it, fgets() should have either handled LineFeeds
the same, or have been given an obviously different name.
Whoever created the disparity in these similarly-named
functions should have done to him what Jesse J. secretly
claimed to want to do to Obama.

I *might* have changed from gets() to fgets() on some
of my private code if it weren't for the above nit.
(And yes, I *do* know how to do
if (*s == '\n') *s = 0;
in C.)
Fifth, an oft-overlooked truism:

Programming (and much real-world activity) involves
compromise between thoroughness and convenience.
strncpy(), for example, can do everything(*) strcpy()
can do, *except*, when properly coded, overrun a buffer.
In other words, the *only* reason to ever use strcpy()
(besides deliberately creating a security loophole!)
is the convenience of a 2-argument function call compared
with a 3-argument call. (* -- yes, strcpy() doesn't
null-pad. Any c.l.c'er ever write code that relied
on the *non*-padding?)

Thoroughness is not wrong, *BUT YOU SHOULD SPEND YOUR
THOROUGHNESS WISELY*. The original Hubbell Telescope
program spent $10,000 studying whether or not to do a
$3 Million test. Meanwhile the flaw, that showed up
post-launch, could have been found with a simple $50 test.
I'll bet some engineer would have done the $50 test
if not dizzied by the testing paperwork requirements
dictated by pedants.
Finally, let's note that programming and lawyerism
are different crafts.

The Authorities(tm) who post so pedantically in this
ng are often not completely wrong, but their pretentious
comments about gets() show confused thinking. In
particular, I wonder if some of them are law school
dropouts.

When I mention the gets()'s that I use, in private,
behind my Impenetrable Firewall(tm), on strings generated
by my own Bugfree Software(tm), they never acknowledge
that some gets()'s are less dangerous than others
but instead reject "safe" usages of gets() based on
pipe(fd);
dup2(fd[0], 0);
write(fd[1], "Hello world\n", 13);
printf("%s\n", gets(buff));
on grounds that the semantics of pipe(), etc. are *not
guaranteed* by the C Standard(tm).

If anyone has trouble understanding the absurdity and
hypocrisy of this legalistic view, I refer them to answers
previously given, here in the ng.

Hope this helps, :-)
James Hussein Allen
Aug 11 '08 #39
James Dow Allen said:
On Aug 10, 6:25 pm, Antoninus Twink <nos...@nospam. invalidwrote:
>a_03.c:(.text+ 0x4d): warning: the `gets' function is dangerous
and should [never] be used.
...
Of course, this is nonsense. There is a perfectly safe way to use
gets(), namely by being in control of what appears on stdin.

Heresy! I'm surprised no one launched a diatribe here
against Mr. Twink,
<shrugThe guy's a troll. It is hardly surprising that he's in a whole
bunch of killfiles.
so let me offer a diatribe in support!
Hmmm.
Six comments on gets().
First, some history. (Some c.l.c'ers weren't
even alive at the time of the infamous Internet
Worm.)
You may be right - but some of us had been adults for a considerable number
of years, even as long ago as 1988. If the online CV I found for a "James
Dow Allen" is yours (which seems likely), then I can't claim to have quite
as many years under my belt as you have, but that's fine by me. :-)

<snip>
It was the exploits of the
Internet Worm that led to the deprecations against
gets().
Right.
(The exploiter, IIRC, wasn't a larcenous
"black hat", but rather a "gray hat" who deliberately
aroused the Unix community from its apathy about
such bugs.)
I think the jury's still out on that - but it's probably fair to say that
"mischief" is a better description of RTM's exploit than "malice" would
be.

<snip>
One doesn't have to be a gets() enthusiast to note
fingerd's special nature, and that the claim that
all gets() usage risks catastrophe is confused.
Yes, of course. Nevertheless, to quote Moff Tarkin's adviser, "We've
analyzed their attack pattern, and there is a danger." Since it's so easy
to use an alternative without such danger, there is no point whatsoever in
using gets().
Second, a confession.
Well, that's up to you. :-)
Third, a boast:

Since another of my "eccentric" codings, in private
throw-away code, is to *not* test malloc()'s return for
zero (failure leads to a core dump, which is what I want
anyway(*)), I'm sure that many in this ng believe that
James Dow Allen's code is buggy!
Yes. But then I believe that *everyone's* code, including mine, is buggy.
I do not believe this is the case.
Well, I have to disagree, partly on general principles and partly because
of laziness - it's far easier for me to consider your (or anyone's) code
to be buggy than to try to defend the effectively indefensible position
that it is not.

<snip>
Code reliability
doesn't require ingenuity (indeed the two may be
inversely related!); it requires conscientiousne ss
and avoiding the cheap substitution of dogma for thought.
True. Nevertheless, dogma /is/ cheap, and can be very effective. Because I
*always* check my mallocs (or at least, consider my failure to do so to be
a bug), I massively reduce the likelihood that my current problem
(whatever that may be) is caused by a failure to check malloc.
AFAIK, I've never used gets() in code I've delivered
to a customer.
I'm delighted to hear it. :-)

<snip>
I do use gets() sometimes, on
private code, when the gets()'ed string was itself
machine-produced.
Here's an analogy for you - any competent electrician will always use
insulated wire when doing a job *for someone else*. And I think the
anti-gets() stance in this group is intended to encourage much the same
responsible attitude - don't expose other people to unnecessary risk. But
the attitude of electricians to home projects may be different - some will
always use insulated wire, whereas some might be content to use
uninsulated wire on occasion because "I know what I'm doing, I know which
bits not to touch, and nobody else ever comes into my cellar anyway".
Whilst this isn't an attitude that I espouse or agree with, I can at least
recognise that just because someone /does/ have that attitude, it doesn't
of itself make them an idiot.

<snip>
The gets() deprecators aren't wrong; indeed I'll cheerfully
concede that their position is more defensible than mine!
Aye.
But I'm happy to take a Devil's Advocate position to
encourage critical thinking when I see the preposterous and
dogmatic over-generalizations which become so routine in
this ng.
Generalisations are always false (even this one), but often useful
nonetheless. Programmers who can't think for themselves shouldn't be
programmers - but some such people insist on programming anyway. If our
advice is "never use gets()", then those who can't think for themselves
might at least let us do their thinking for them. And those who can, will
(hopefully) take our advice seriously and then make up their own minds.
Is gets() a *potential* source of bugs? Obviously.
Right.
But I'd love to organize a wager, between me and one of
the pedants, on whose code contains more *actual* bugs.
Oh, I'm sure that my code has more bugs than yours. But they're /different/
bugs. :-)
* - Detractors will argue that what I *should* want to
do is spend hours writing a diagnostic for such malloc()
failures! In fact I don't want to do anything about them
since the smallish malloc()'s I use to build the website
Aren't Going To Fail(tm).
When they do, though, wouldn't it be more convenient for you if your
website-building program told you about them?
(The pedants will respond to
this with some nonsense about how the website building
may be ported, some day, to the limited-memory chip
inside my car's fuel injection system !)
Didn't you know? All the best Web sites are built in carburettors.
Fourth, a peeve:

fgets() preserves LineFeeds,
Yes, and you can understand why. The line might be longer than the buffer,
so there might not *be* a newline. If you discard those that you find, how
will the program know whether there was a newline or not, at a particular
point in the file?
gets() discards them.
Again, you can understand why.
Either behavior is fine (an application whose
stringency requires special treatment of an
"unterminat ed last line" probably will avoid
fgets() for other reasons anyway), but similarly-named
functions *SHOULD BEHAVE SIMILARLY*.
Symmetry. gets removes the newline, and puts restores it. fgets leaves the
newline (if present), so fputs doesn't need to restore it.

<snip>
Fifth, an oft-overlooked truism:

Programming (and much real-world activity) involves
compromise between thoroughness and convenience.
strncpy(), for example, can do everything(*) strcpy()
can do, *except*, when properly coded, overrun a buffer.
In other words, the *only* reason to ever use strcpy()
(besides deliberately creating a security loophole!)
is the convenience of a 2-argument function call compared
with a 3-argument call.
I have to disagree with this. I had a very, very long (but astonishingly
amicable) discussion with someone who held your view, some time ago, in
alt.comp.lang.l earn.c-c++ - and he came up with a zillion arguments in
favour of strncpy over strcpy. I patiently deconstructed these arguments
one by one, and eventually (much to his credit) my correspondent
recognised that his position was indefensible, and changed his mind. But
it was a very long discussion, and I have no particular desire to re-enact
it. It'll be in the archives somewhere. (You know the newsgroup, and IIRC
my correspondent was "Chris Val", although I could be mistaken.)
(* -- yes, strcpy() doesn't
null-pad. Any c.l.c'er ever write code that relied
on the *non*-padding?)
No, but TANSTAAFL. Padding takes time. Okay, so premature optimisation is
the root of all evil - but the converse (that premature pessimisation is
the root of all virtue) has yet to be demonstrated.
Thoroughness is not wrong, *BUT YOU SHOULD SPEND YOUR
THOROUGHNESS WISELY*.
Yes. I think I do.

<snip>
Finally, let's note that programming and lawyerism
are different crafts.
Yes. A lawyer only has to persuade a judge to do things his way. A
programmer has to persuade a *computer* to do things his way. That can be
a lot more difficult, and require a much more pedantic approach.

<snip>

--
Richard Heathfield <http://www.cpax.org.uk >
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Aug 11 '08 #40

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

101
3400
by: Bill Cunningham | last post by:
I read an article in a book about Perl and Common Gateway Interface and it mentioned C. It said that C could damage your computer. I don't know wether it meant the standard or compiler issuses. I was a little upset. Well more upset. I sent Dennis Ritchie and email. I don't know if he'll respond if he gets it. Sometimes he does sometimes not. How can C damage your computer? Bill
1
2846
by: b83503104 | last post by:
When are they not consistent?
4
1303
by: cesark | last post by:
Hi ! I have important doubts about how to handle the security in asp.net vb.net web forms. Somebody can help me? 1. If you have setting ‘validateRequest=true’ in .net framework1.1, What can do you do to improve the security? Because although you have validations on server side you can enter dangerous characters in a text field, with the exception of telephone numbers or similar.
302
18633
by: Lee | last post by:
Hi Whenever I use the gets() function, the gnu c compiler gives a warning that it is dangerous to use gets(). Is this due to the possibility of array overflow? Is it correct that the program flow can be altered by giving some specific calculated inputs to gets()? How could anyone do so once the executable binary have been generated? I have heard many of the security problems and other bugs are due to array overflows.
6
7473
by: Brendan | last post by:
Hi, I'm trying to mimic the IPC/messaging system of an specific OS in a portable way by using GCC's library. The IPC system uses buffered asynchronous messages, where any thread can send a message to any other thread (i.e. to the "threadID") without blocking, and the receiver does any security checks necessary. I'm trying to implement the portable/linux version on top of sockets/datagrams ("SOCK_DGRAM" in the local namespace), and so...
10
9375
by: lovecreatesbea... | last post by:
C stops the conversion from (char **) to (const char **). c-faq.com sec 11.10 has explanation on this point. But, for example, even the conversion from (char *) to (const char *) brings the same dangerous as in the previous conversion. Why the latter simple but dangerous one is allowed in C? $ cat f1.c int main(void) { const char c = 'a';
6
3584
by: Thomas.li | last post by:
Hi, I want to convert CString to LPBYTE like LPBYTE lpByte = (BYTE*)(LPCTSTR)cstring; is it very dangerous to do that?
0
9697
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10586
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10648
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7828
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7017
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5682
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5866
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4484
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3134
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.