Click here to Skip to main content
15,887,952 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to implement PrintScreen functionality in VC++6.0 Pin
Arun Abraham Jose14-Oct-09 3:21
Arun Abraham Jose14-Oct-09 3:21 
QuestionGet List of Devices Currently Attached in a thread [modified] Pin
tibbasultanpur12-Oct-09 0:04
tibbasultanpur12-Oct-09 0:04 
AnswerPlease reformat your code snippets Pin
CPallini12-Oct-09 0:20
mveCPallini12-Oct-09 0:20 
AnswerRe: Get List of Devices Currently Attached in a thread Pin
David Crow12-Oct-09 3:01
David Crow12-Oct-09 3:01 
GeneralRe: Get List of Devices Currently Attached in a thread Pin
tibbasultanpur12-Oct-09 18:17
tibbasultanpur12-Oct-09 18:17 
QuestionRe: Get List of Devices Currently Attached in a thread Pin
David Crow13-Oct-09 2:54
David Crow13-Oct-09 2:54 
QuestionInitialize into const char** Pin
m_mun11-Oct-09 23:15
m_mun11-Oct-09 23:15 
AnswerRe: Initialize into const char** Pin
Iain Clarke, Warrior Programmer11-Oct-09 23:20
Iain Clarke, Warrior Programmer11-Oct-09 23:20 
Well, look at the parameters.

You pass it a pointer to a pointer to a bunch of chars.

In C/C++, the most basic string is a pointer to a bunch of chars, usually NULL terminated.

So, we can say that fn_VersionInfo takes a pointer to a string. So you pass a pointer to a string.

That could either be a string you create yourself, or one that function creates for you. I suspect the latter, but you'll have to read the documentation to discover that.

Where is this function from? Does it have any documentation? Can you read the source?
If you let it create a string, who is responsible for deleting it afterwards?

Answering that last question will answer your original question.
*Not* looking for the answer to my last question means you will at best get bad habits, at worst will make your software crash when two parts of it try and tidy up the same variable twice.

Iain.

ps, I appear to be dishing out lessons in paranoid programming today. Like there's any other kind...

I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[^]

GeneralRe: Initialize into const char** Pin
m_mun11-Oct-09 23:43
m_mun11-Oct-09 23:43 
AnswerRe: Initialize into const char** Pin
CPallini12-Oct-09 0:08
mveCPallini12-Oct-09 0:08 
GeneralRe: Initialize into const char** Pin
m_mun12-Oct-09 0:32
m_mun12-Oct-09 0:32 
AnswerRe: Initialize into const char** Pin
«_Superman_»12-Oct-09 8:58
professional«_Superman_»12-Oct-09 8:58 
Question40 bit decimal to binary Pin
Makakuin11-Oct-09 21:03
Makakuin11-Oct-09 21:03 
AnswerRe: 40 bit decimal to binary Pin
CPallini11-Oct-09 22:19
mveCPallini11-Oct-09 22:19 
Questionhow to check if a thread handle is available Pin
Hari_1611-Oct-09 19:49
Hari_1611-Oct-09 19:49 
AnswerRe: how to check if a thread handle is available Pin
Iain Clarke, Warrior Programmer11-Oct-09 20:47
Iain Clarke, Warrior Programmer11-Oct-09 20:47 
AnswerRe: how to check if a thread handle is available Pin
CPallini11-Oct-09 22:21
mveCPallini11-Oct-09 22:21 
Questionconvert pdf to tif file in C Pin
billcodes11-Oct-09 18:49
billcodes11-Oct-09 18:49 
AnswerRe: convert pdf to tif file in C Pin
Iain Clarke, Warrior Programmer11-Oct-09 20:55
Iain Clarke, Warrior Programmer11-Oct-09 20:55 
GeneralRe: convert pdf to tif file in C Pin
billcodes11-Oct-09 22:08
billcodes11-Oct-09 22:08 
QuestionRe: convert pdf to tif file in C Pin
CPallini11-Oct-09 22:24
mveCPallini11-Oct-09 22:24 
GeneralRe: convert pdf to tif file in C Pin
Iain Clarke, Warrior Programmer11-Oct-09 22:45
Iain Clarke, Warrior Programmer11-Oct-09 22:45 
GeneralRe: convert pdf to tif file in C Pin
AspDotNetDev15-Oct-09 15:30
protectorAspDotNetDev15-Oct-09 15:30 
GeneralRe: convert pdf to tif file in C Pin
kilt13-Oct-09 2:23
kilt13-Oct-09 2:23 
GeneralRe: convert pdf to tif file in C Pin
Henry Minute13-Oct-09 5:23
Henry Minute13-Oct-09 5:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.