Click here to Skip to main content
15,902,938 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Web server sing VC++/MFC Pin
Nemanja Trifunovic16-Feb-07 4:35
Nemanja Trifunovic16-Feb-07 4:35 
Questionhow to run an application at windows startup? Pin
Super Hornet16-Feb-07 4:09
Super Hornet16-Feb-07 4:09 
AnswerRe: how to run an application at windows startup? Pin
Newbie0016-Feb-07 4:19
Newbie0016-Feb-07 4:19 
GeneralRe: how to run an application at windows startup? Pin
Super Hornet16-Feb-07 4:50
Super Hornet16-Feb-07 4:50 
GeneralRe: how to run an application at windows startup? Pin
PJ Arends16-Feb-07 8:27
professionalPJ Arends16-Feb-07 8:27 
GeneralRe: how to run an application at windows startup? Pin
Newbie0016-Feb-07 8:30
Newbie0016-Feb-07 8:30 
AnswerRe: how to run an application at windows startup? Pin
led mike16-Feb-07 4:55
led mike16-Feb-07 4:55 
Questionstrcpy giving exception Pin
sanjutvm16-Feb-07 3:27
sanjutvm16-Feb-07 3:27 
Hi,

I'm using MFC extension dll.

I've 2 questions.

1. Why do i get exception while trying this:

char* s1 = "";
char* s2 = abc";
strcpy(s1,s2); //exception

But if i try this it works:
char s1[255];
char* s2 = abc";
strcpy(s1,s2);

Why is this so?

2. I've an exposed function BOOL _stdcall SetName(CString& name)

There is a function defined in another class but in same dll as below.

void CMyClass::Myfn(CString& str)
{
m_str = str;
}

where m_str is CString variable declared in header and initialized as
m_str = "" in CMyClass constructor.

I create an object of CMyClass and call Myfn() in SetName.
SetName is called from a vb.net application.

I get exception while assigning m_str = str in Myfn();

(This works fine if i'm calling the dll from an MFC application.)

I solved the problem by making the following changes.
m_str declaration as char m_str[255] and removed initialization from constructor.
Myfn() as
void CMyClass::Myfn(char* str)
{
strcpy(m_str,str)
}

But how did it work? Will it create problem in anyother scenario?





Thanks & Regards,
sanju
AnswerRe: strcpy giving exception Pin
toxcct16-Feb-07 3:45
toxcct16-Feb-07 3:45 
AnswerRe: strcpy giving exception Pin
Cedric Moonen16-Feb-07 3:53
Cedric Moonen16-Feb-07 3:53 
AnswerRe: strcpy giving exception Pin
Chris Losinger16-Feb-07 3:57
professionalChris Losinger16-Feb-07 3:57 
GeneralRe: strcpy giving exception Pin
sanjutvm18-Feb-07 19:45
sanjutvm18-Feb-07 19:45 
GeneralRe: strcpy giving exception Pin
Chris Losinger19-Feb-07 1:16
professionalChris Losinger19-Feb-07 1:16 
GeneralRe: strcpy giving exception Pin
sanjutvm20-Feb-07 18:58
sanjutvm20-Feb-07 18:58 
GeneralRe: strcpy giving exception Pin
Chris Losinger21-Feb-07 0:58
professionalChris Losinger21-Feb-07 0:58 
GeneralRe: strcpy giving exception Pin
sanjutvm23-Feb-07 3:29
sanjutvm23-Feb-07 3:29 
QuestionWorking with huge Floating Point Numbers Pin
Semion_N16-Feb-07 2:57
Semion_N16-Feb-07 2:57 
AnswerRe: Working with huge Floating Point Numbers Pin
Newbie0016-Feb-07 3:51
Newbie0016-Feb-07 3:51 
AnswerRe: Working with huge Floating Point Numbers Pin
Chris Losinger16-Feb-07 3:52
professionalChris Losinger16-Feb-07 3:52 
GeneralRe: Working with huge Floating Point Numbers Pin
Semion_N16-Feb-07 4:14
Semion_N16-Feb-07 4:14 
GeneralRe: Working with huge Floating Point Numbers Pin
Chris Losinger16-Feb-07 4:25
professionalChris Losinger16-Feb-07 4:25 
GeneralRe: Working with huge Floating Point Numbers Pin
Semion_N16-Feb-07 9:22
Semion_N16-Feb-07 9:22 
GeneralRe: Working with huge Floating Point Numbers Pin
Chris Losinger16-Feb-07 10:09
professionalChris Losinger16-Feb-07 10:09 
GeneralRe: Working with huge Floating Point Numbers Pin
Semion_N16-Feb-07 18:46
Semion_N16-Feb-07 18:46 
GeneralRe: Working with huge Floating Point Numbers Pin
Chris Losinger16-Feb-07 18:50
professionalChris Losinger16-Feb-07 18:50 

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.