Click here to Skip to main content
15,911,531 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: change buttons style Pin
Nishad S27-Sep-07 2:55
Nishad S27-Sep-07 2:55 
GeneralRe: change buttons style Pin
mitok27-Sep-07 3:13
mitok27-Sep-07 3:13 
GeneralRe: change buttons style Pin
Nishad S27-Sep-07 3:30
Nishad S27-Sep-07 3:30 
GeneralRe: change buttons style Pin
mitok27-Sep-07 3:52
mitok27-Sep-07 3:52 
GeneralRe: change buttons style Pin
Nishad S27-Sep-07 4:06
Nishad S27-Sep-07 4:06 
AnswerRe: change buttons style Pin
Naveen27-Sep-07 2:48
Naveen27-Sep-07 2:48 
GeneralRe: change buttons style Pin
Nishad S27-Sep-07 2:56
Nishad S27-Sep-07 2:56 
QuestionIs this idea viable? (about dll and namespace) Pin
Nelek27-Sep-07 0:05
protectorNelek27-Sep-07 0:05 
Hi all,

I would like to know if the following idea is correct or is better to do it in other way. (I’m not asking for particular code, I will try it in my own).

I’m just starting with DLLs programming. In my project I need to communicate my Win32 *.exe with a PLC. To do that I have found a DLL that makes the connection, but the problem now is how to read from / write to the PLC. The problem I have is that the WriteTo functions have to be in a DLL for security to avoid as many problems as possible.

In my *.exe I have a view “MonitorCenterView” where all the functionality of the connection will be used through the third party dll. The read functions are going to be programmed there, but the write (as I said) in a DLL. Changing the “working mode” want to be sure my file is there, so I want to check out if one member parameter in the dll has a concrete value (like a license or a password) and if all is good then use the function of the dll.

I have thought to make something like this:

including the *.lib to have the directions/links to the functions in the dll in my *.exe but delivering only the *.dll when I want to.

void CMonitorCenterView::OnChangeWorkingMode ()
{
//DialogBox to change the mode and returning "write"
;
if (write::CheckValidDll () )
	using namespace write;
;
WriteCodeToPLC (param1, param2, …);
;
//more code
return;
}
;
;
;
//Somewhere else in the same CMonitorCenter
void CMonitorCenterView::WriteCodeToPLC (param1, param2, …)
{
	MessageBox (NULL, "This function is not allowed without the \"write.dll\". Please contact with XXXX", "Error", MB_OK);
}


So when the validation returns TRUE, then the function WriteCodeToPLC (…) will be called from the dll and do its job uploading the code. But if the validation returns FALSE, then the WriteCodeToPLC (...) will be called from the actual class and give the message box with the error.

One question please: If I use the using namespace XXX… Does it just have local validation as a variable defined in the function? Or is it global and need to be “reseted” after? How can abort it afterwards if needed?


Sorry for the extension and thanks for any comment / suggestion / correction, everything will be welcome


Greetings.

--------
M.D.V.

If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?

Help me to understand what I'm saying, and I'll explain it better to you

Wink | ;)

AnswerRe: Is this idea viable? (about dll and namespace) Pin
Cedric Moonen27-Sep-07 0:50
Cedric Moonen27-Sep-07 0:50 
GeneralRe: Is this idea viable? (about dll and namespace) Pin
Nelek27-Sep-07 1:49
protectorNelek27-Sep-07 1:49 
QuestionArticles on SAFEARRAY for implementing in VC++ Pin
shir_k26-Sep-07 23:54
shir_k26-Sep-07 23:54 
AnswerRe: Articles on SAFEARRAY for implementing in VC++ Pin
toxcct27-Sep-07 0:07
toxcct27-Sep-07 0:07 
Questionsetfocus Pin
bhogavalli suresh26-Sep-07 23:40
bhogavalli suresh26-Sep-07 23:40 
GeneralRe: setfocus Pin
Stephen Hewitt27-Sep-07 14:47
Stephen Hewitt27-Sep-07 14:47 
AnswerRe: setfocus Pin
Sunil P V26-Sep-07 23:52
Sunil P V26-Sep-07 23:52 
GeneralRe: setfocus Pin
Stephen Hewitt27-Sep-07 14:48
Stephen Hewitt27-Sep-07 14:48 
AnswerRe: setfocus Pin
zakkas248326-Sep-07 23:54
zakkas248326-Sep-07 23:54 
GeneralRe: setfocus Pin
Naveen27-Sep-07 0:17
Naveen27-Sep-07 0:17 
GeneralRe: setfocus Pin
zakkas248327-Sep-07 0:40
zakkas248327-Sep-07 0:40 
GeneralRe: setfocus Pin
Stephen Hewitt27-Sep-07 14:48
Stephen Hewitt27-Sep-07 14:48 
GeneralRe: setfocus Pin
zakkas248327-Sep-07 20:59
zakkas248327-Sep-07 20:59 
AnswerRe: setfocus Pin
Nishad S27-Sep-07 1:45
Nishad S27-Sep-07 1:45 
QuestionRe: setfocus Pin
David Crow27-Sep-07 3:11
David Crow27-Sep-07 3:11 
AnswerRe: setfocus Pin
Stephen Hewitt30-Sep-07 15:31
Stephen Hewitt30-Sep-07 15:31 
AnswerRe: setfocus Pin
Mark Salsbery27-Sep-07 5:36
Mark Salsbery27-Sep-07 5:36 

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.