Click here to Skip to main content
15,919,500 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: can't use exported func in a namespace Pin
happycpp3-Feb-05 10:25
happycpp3-Feb-05 10:25 
GeneralRe: can't use exported func in a namespace Pin
happycpp6-Feb-05 10:29
happycpp6-Feb-05 10:29 
GeneralVC++ abt buttons Pin
Tripura.K3-Feb-05 2:41
Tripura.K3-Feb-05 2:41 
GeneralRe: VC++ abt buttons Pin
David Crow3-Feb-05 2:51
David Crow3-Feb-05 2:51 
GeneralRe: VC++ abt buttons Pin
Ravi Bhavnani3-Feb-05 7:46
professionalRavi Bhavnani3-Feb-05 7:46 
GeneralRe: VC++ abt buttons Pin
Tripura.K3-Feb-05 22:26
Tripura.K3-Feb-05 22:26 
GeneralDriver architecture advice needed Pin
@Work3-Feb-05 1:48
@Work3-Feb-05 1:48 
GeneralRe: Driver architecture advice needed Pin
Antti Keskinen3-Feb-05 3:44
Antti Keskinen3-Feb-05 3:44 
Hi !

I'm somewhat unsure what you're trying to do. I take it that PLC stands for Programmable Logic Controller, yes ? In this case, how do these controllers connect to your PC ? Do you have any hardware-level drivers which allow sending and receiving data from the controller ? Or is it your task to develop a Windows hardware driver to communicate with the controllers ?

If you're developing a hardware driver, DO NOT USE MFC. That's something you just DO NOT do. Drivers are written mainly in C, and do not use MFC. If you've never written a hardware driver, then you're in for a mess. First write the driver itself, then consider options on how to allow client access to the driver. Do not incorporate direct client access to the driver itself (that means, use a DLL to interface a client application to the driver), because this hampers the reliability of the driver. Unreliable drivers will crash the OS.

If you already have a device driver provided by the PLC manufacturer, that allows you to send and receive data from the controller, and you're building the DLL that allows flexible access to the driver, then you can use MFC if you need to, but it's again not recommended. MFC is mainly for user interface applications, or solid Windows applications.
In this case, the best option is to create a COM component which, when opened up, opens a handle to the device driver, and then offers an interface through which data can be written and read. Writing a COM component is quite easy when you use the wizards. They generate most of the background code and your job is to implement the actual business logic.

To get you started on COM development, consult your local library for possible books. Rest assured, COM will not go anywhere, it will remain around for a long time still. Learning it is useful, because a lot of Windows subsystems, such as WMI or DirectX, are implemented as COM objects.

If you need more information, post more details on the project, such as what the PLC actually is, if you have a hardware driver from the manufacturer and what the precise task you're trying to accomplish is.

-Antti Keskinen

----------------------------------------------
"If we wrote a report stating we saw a jet fighter with a howitzer, who's going to believe us ?"

-- R.A.F. pilot quote on seeing a Me 262 armed with a 50mm Mauser cannon.
GeneralRe: Driver architecture advice needed Pin
Geert van Horrik3-Feb-05 20:41
Geert van Horrik3-Feb-05 20:41 
GeneralRe: Driver architecture advice needed Pin
Antti Keskinen3-Feb-05 23:14
Antti Keskinen3-Feb-05 23:14 
GeneralRe: Driver architecture advice needed Pin
Geert van Horrik3-Feb-05 23:23
Geert van Horrik3-Feb-05 23:23 
GeneralRe: Driver architecture advice needed Pin
Antti Keskinen3-Feb-05 23:48
Antti Keskinen3-Feb-05 23:48 
GeneralRe: Driver architecture advice needed Pin
Geert van Horrik4-Feb-05 0:01
Geert van Horrik4-Feb-05 0:01 
GeneralRe: Driver architecture advice needed Pin
Antti Keskinen4-Feb-05 1:05
Antti Keskinen4-Feb-05 1:05 
GeneralRe: Driver architecture advice needed Pin
Geert van Horrik4-Feb-05 1:15
Geert van Horrik4-Feb-05 1:15 
GeneralCharting Pin
_Tom_3-Feb-05 1:24
_Tom_3-Feb-05 1:24 
GeneralRe: Charting Pin
David Crow3-Feb-05 3:47
David Crow3-Feb-05 3:47 
GeneralRe: Charting Pin
krmed3-Feb-05 6:51
krmed3-Feb-05 6:51 
GeneralGet system properies at runtime Pin
Member 16603853-Feb-05 1:13
Member 16603853-Feb-05 1:13 
GeneralRe: Get system properies at runtime Pin
David Crow3-Feb-05 2:54
David Crow3-Feb-05 2:54 
Generalabt keyboard Pin
Anonymous3-Feb-05 1:13
Anonymous3-Feb-05 1:13 
GeneralRe: abt keyboard Pin
Mike Dimmick3-Feb-05 2:43
Mike Dimmick3-Feb-05 2:43 
QuestionChanging Source IP ? Pin
Adnan5623-Feb-05 0:56
Adnan5623-Feb-05 0:56 
AnswerRe: Changing Source IP ? Pin
Antony M Kancidrowski3-Feb-05 1:13
Antony M Kancidrowski3-Feb-05 1:13 
GeneralApply different themes to single application Pin
ledallam2-Feb-05 23:39
ledallam2-Feb-05 23:39 

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.