Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 2

Qt-interest Archive, March 2008
How to implement a Client/Server DDE (Dynamic Data Exchange)


Message 1 in thread

Hi,

I need to implement a Client/Server DDE. Is there any way to do it with Qt  
?

Regards,
Jefferson.

--
 [ signature omitted ] 

Message 2 in thread

Short answer is: no.

I have encapsulated some DDE functionality into some C++ classes to
use with a custom version of psi some years ago. I will check if I can
still find the source and send them to you.
But basically, you will have to rely on Win32 API calls. Qt can't help you.

As a side note: You shouldn't be using DDE. It is pretty much an
outdated technology, even not recommended by Microsoft.


Regards

On Sat, Mar 8, 2008 at 10:56 PM, Jefferson Costa
<jsampaio123@xxxxxxxxxxxx> wrote:
> Hi,
>
>  I need to implement a Client/Server DDE. Is there any way to do it with Qt
>  ?
>
>  Regards,
>  Jefferson.
>
>  --
>  To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the subject or the body.
>  List archive and information: http://lists.trolltech.com/qt-interest/
>
>

--
 [ signature omitted ] 

Message 3 in thread

I Know. But the application that iÂm trying to communicate only use DDE.  
Then i donÂt have choice >(.

Regards,
Jefferson.

Em Sat, 08 Mar 2008 23:17:51 -0300, Rafael Roquetto  
<rafaelroquetto@xxxxxxxxx> escreveu:

> Short answer is: no.
>
> I have encapsulated some DDE functionality into some C++ classes to
> use with a custom version of psi some years ago. I will check if I can
> still find the source and send them to you.
> But basically, you will have to rely on Win32 API calls. Qt can't help  
> you.
>
> As a side note: You shouldn't be using DDE. It is pretty much an
> outdated technology, even not recommended by Microsoft.
>
>
> Regards
>
> On Sat, Mar 8, 2008 at 10:56 PM, Jefferson Costa
> <jsampaio123@xxxxxxxxxxxx> wrote:
>> Hi,
>>
>>  I need to implement a Client/Server DDE. Is there any way to do it  
>> with Qt
>>  ?
>>
>>  Regards,
>>  Jefferson.
>>
>>  --
>>  To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with  
>> "unsubscribe" in the subject or the body.
>>  List archive and information: http://lists.trolltech.com/qt-interest/
>>
>>
>
> Esta mensagem foi verificada pelo E-mail Protegido Terra.
> Scan engine: McAfee VirusScan / Atualizado em 07/03/2008 / VersÃo:  
> 5.2.00/5247
> Proteja o seu e-mail Terra: http://mail.terra.com.br/
>


--
 [ signature omitted ] 

Message 4 in thread

Ok. When ? :)

Regars,
Jefferson.

Em Sat, 08 Mar 2008 23:17:51 -0300, Rafael Roquetto  
<rafaelroquetto@xxxxxxxxx> escreveu:

> Short answer is: no.
>
> I have encapsulated some DDE functionality into some C++ classes to
> use with a custom version of psi some years ago. I will check if I can
> still find the source and send them to you.
> But basically, you will have to rely on Win32 API calls. Qt can't help  
> you.
>
> As a side note: You shouldn't be using DDE. It is pretty much an
> outdated technology, even not recommended by Microsoft.
>
>
> Regards
>
> On Sat, Mar 8, 2008 at 10:56 PM, Jefferson Costa
> <jsampaio123@xxxxxxxxxxxx> wrote:
>> Hi,
>>
>>  I need to implement a Client/Server DDE. Is there any way to do it  
>> with Qt
>>  ?
>>
>>  Regards,
>>  Jefferson.
>>
>>  --
>>  To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with  
>> "unsubscribe" in the subject or the body.
>>  List archive and information: http://lists.trolltech.com/qt-interest/
>>
>>
>
> Esta mensagem foi verificada pelo E-mail Protegido Terra.
> Scan engine: McAfee VirusScan / Atualizado em 07/03/2008 / Versão:  
> 5.2.00/5247
> Proteja o seu e-mail Terra: http://mail.terra.com.br/
>


--
 [ signature omitted ] 

Message 5 in thread

There you are.

You are lucky I found this. I didnt even think I would have it. I have
spoken to the copyright holder and he is ok to distribute it under
GPL. So, please make sure you use it with GPL software. This software
you are developing is GPL, isn't it?

You will use three methods

DDEComm::getInstance();
DEComm::ddeRequest();
DDECom::ddeExecute();

Please note these classes rely on Qt3, not Qt4. They are pretty old,
however the only Qt class they rely on is QString. Therefore you will
have to make the appropriate changes.

Rafael

On Mon, Mar 10, 2008 at 11:30 AM, Jefferson Costa
<jsampaio123@xxxxxxxxxxxx> wrote:
> Ok. When ? :)
>
>  Regars,
>
> Jefferson.
>
>  Em Sat, 08 Mar 2008 23:17:51 -0300, Rafael Roquetto
>  <rafaelroquetto@xxxxxxxxx> escreveu:
>
>
>
> > Short answer is: no.
>  >
>  > I have encapsulated some DDE functionality into some C++ classes to
>  > use with a custom version of psi some years ago. I will check if I can
>  > still find the source and send them to you.
>  > But basically, you will have to rely on Win32 API calls. Qt can't help
>  > you.
>  >
>  > As a side note: You shouldn't be using DDE. It is pretty much an
>  > outdated technology, even not recommended by Microsoft.
>  >
>  >
>  > Regards
>  >
>  > On Sat, Mar 8, 2008 at 10:56 PM, Jefferson Costa
>  > <jsampaio123@xxxxxxxxxxxx> wrote:
>  >> Hi,
>  >>
>  >>  I need to implement a Client/Server DDE. Is there any way to do it
>  >> with Qt
>  >>  ?
>  >>
>  >>  Regards,
>  >>  Jefferson.
>  >>
>  >>  --
>  >>  To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
>  >> "unsubscribe" in the subject or the body.
>  >>  List archive and information: http://lists.trolltech.com/qt-interest/
>  >>
>  >>
>  >
>
>
> > Esta mensagem foi verificada pelo E-mail Protegido Terra.
>  > Scan engine: McAfee VirusScan / Atualizado em 07/03/2008 / Versão:
>  > 5.2.00/5247
>  > Proteja o seu e-mail Terra: http://mail.terra.com.br/
>  >
>
>
>
/*
/*
 * ddecomm.h 
 * Implements the interface for DDE communication class.
 *
 * (C) 2005 Insite Comercio e Servicos.
 *
 * Author: Rafael Roquetto
 *
 *  
 * Created on 2005-06-03.
 *
 * This is GPL software
 *
 */
 
#include "ddecomm.h"
#include <qstring.h>

DDEComm* DDEComm::_instance = NULL;

DDEComm* DDEComm::instance()
{
	if(_instance == NULL)
		_instance = new DDEComm();
	
	return _instance;
}

DDEComm::DDEComm()
{
    connStatus = false;
    callback = NULL;
    pidInst = 0;
    hConv = 0L;
}

DDEComm::~DDEComm()
{
    //Empty
}

bool DDEComm::ddeConnect(const QString &service, const QString &topic)
{
	if(callback == NULL)
	{
		if(DdeInitializeA(&pidInst, NULL, APPCLASS_STANDARD | APPCMD_CLIENTONLY, 0L) != DMLERR_NO_ERROR)
			return false;
	}
	else
	{		
		if(DdeInitializeA(&pidInst, (PFNCALLBACK) callback, APPCLASS_STANDARD | APPCMD_CLIENTONLY | MF_CONV | MF_ERRORS, 0L) != DMLERR_NO_ERROR)
			return false;
	}

	hszService = DdeCreateStringHandleA(pidInst, service, CP_WINANSI);
	hszTopic = DdeCreateStringHandleA(pidInst, topic, CP_WINANSI);
	hConv = DdeConnect(pidInst, hszService, hszTopic, NULL);

	DdeFreeStringHandle(pidInst, hszService);
	DdeFreeStringHandle(pidInst, hszTopic);

	if(!hConv)
        	return false;
    	
	connStatus = true;

	return true;
}

void DDEComm::ddeDisconnect()
{
	DdeDisconnect(hConv);
	DdeUninitialize(pidInst);
	connStatus = false;
}

void DDEComm::setDDECallback(PFNCALLBACK ddeCallback)
{
	callback = ddeCallback;
}

QString DDEComm::ddeRequest(const QString &item)
{
	if(!connStatus)
        	return NULL;


	hszRequest = DdeCreateStringHandleA(pidInst, item, CP_WINANSI);
	recData = DdeClientTransaction(NULL, 0, hConv, hszRequest, CF_TEXT, XTYP_REQUEST, 1000, NULL);
	byte = DdeAccessData(recData, &dwLength);

	char *data = (char*) byte;
	QString retStr = data;
	DdeFreeStringHandle(pidInst, hszRequest);
	DdeFreeDataHandle(recData);
	return retStr;
}

QString DDEComm::ddeExecute(const QString &command, const QString &result)
{
   
	transactionData = DdeCreateDataHandle(pidInst, (LPBYTE) command.ascii(), strlen(command.ascii()), 0, 0L, CF_TEXT, NULL);
	DdeClientTransaction((LPBYTE) transactionData, -1, hConv, 0L, 0, XTYP_EXECUTE, 1000, NULL);

	QString returnData = ddeRequest(result);

	DdeFreeDataHandle(transactionData);

	
	return returnData;
}
/*
/*
 * ddecomm.h 
 * Defines the interface for DDE communication class.
 *
 * (C) 2005 Insite Comercio e Servicos.
 *
 * Author: Rafael Roquetto
 *
 *  
 * Created on 2005-06-03.
 *
 * This is GPL software
 *
 */
 
#ifndef DDECOMM_H
#define DDECOMM_H

#include <windows.h>
#include <qstring.h>

/*!
 * Classe singleton que fornece métodos para comunicacao via DDE
 */


class DDEComm 
{
	public:
	        
		static DDEComm* instance(); /*!< retorna um ponteiro para a instancia de DDEComm */
		
	        bool ddeConnect(const QString & service, const QString & topic); /*!< Connecta ao servico DDE, no topico desejado */

		void ddeDisconnect(); /*!< Desconecta do servico DDE*/
	        void setDDECallback(PFNCALLBACK ddeCallback); /*!< Seta uma funcao de callback a ser chamada na ocorrencia de eventos DDE */
        
	        QString ddeRequest(const QString & item); /*!< Faz um request dde para o item fornecido */
	        QString ddeExecute(QString command, QString result); /*!< Executa um comando no servidor dde*/

	protected:
		DDEComm();
		~DDEComm();

	private:
	        bool connStatus;
	        PFNCALLBACK callback; //pointer to callback
        
	        HCONV hConv;
	        HSZ hszService;
	        HSZ hszTopic;
	        HDDEDATA recData;
	        HDDEDATA transactionData;
	        HSZ hszRequest;
	        LPDWORD result;
	        DWORD dwLength;
	        LPBYTE byte;
		DWORD pidInst;

		static DDEComm *_instance;

};
#endif /*DDECOMM_H*/

Message 6 in thread

Ok. IÂll try it. Thks.

Jefferson.

Em Mon, 10 Mar 2008 13:33:43 -0300, Rafael Roquetto  
<rafaelroquetto@xxxxxxxxx> escreveu:

> There you are.
>
> You are lucky I found this. I didnt even think I would have it. I have
> spoken to the copyright holder and he is ok to distribute it under
> GPL. So, please make sure you use it with GPL software. This software
> you are developing is GPL, isn't it?
>
> You will use three methods
>
> DDEComm::getInstance();
> DEComm::ddeRequest();
> DDECom::ddeExecute();
>
> Please note these classes rely on Qt3, not Qt4. They are pretty old,
> however the only Qt class they rely on is QString. Therefore you will
> have to make the appropriate changes.
>
> Rafael
>
> On Mon, Mar 10, 2008 at 11:30 AM, Jefferson Costa
> <jsampaio123@xxxxxxxxxxxx> wrote:
>> Ok. When ? :)
>>
>>  Regars,
>>
>> Jefferson.
>>
>>  Em Sat, 08 Mar 2008 23:17:51 -0300, Rafael Roquetto
>>  <rafaelroquetto@xxxxxxxxx> escreveu:
>>
>>
>>
>> > Short answer is: no.
>>  >
>>  > I have encapsulated some DDE functionality into some C++ classes to
>>  > use with a custom version of psi some years ago. I will check if I  
>> can
>>  > still find the source and send them to you.
>>  > But basically, you will have to rely on Win32 API calls. Qt can't  
>> help
>>  > you.
>>  >
>>  > As a side note: You shouldn't be using DDE. It is pretty much an
>>  > outdated technology, even not recommended by Microsoft.
>>  >
>>  >
>>  > Regards
>>  >
>>  > On Sat, Mar 8, 2008 at 10:56 PM, Jefferson Costa
>>  > <jsampaio123@xxxxxxxxxxxx> wrote:
>>  >> Hi,
>>  >>
>>  >>  I need to implement a Client/Server DDE. Is there any way to do it
>>  >> with Qt
>>  >>  ?
>>  >>
>>  >>  Regards,
>>  >>  Jefferson.
>>  >>
>>  >>  --
>>  >>  To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx  
>> with
>>  >> "unsubscribe" in the subject or the body.
>>  >>  List archive and information:  
>> http://lists.trolltech.com/qt-interest/
>>  >>
>>  >>
>>  >
>>
>>
>> > Esta mensagem foi verificada pelo E-mail Protegido Terra.
>>  > Scan engine: McAfee VirusScan / Atualizado em 07/03/2008 / VersÃo:
>>  > 5.2.00/5247
>>  > Proteja o seu e-mail Terra: http://mail.terra.com.br/
>>  >
>>
>>
>>
>
> Esta mensagem foi verificada pelo E-mail Protegido Terra.
> Scan engine: McAfee VirusScan / Atualizado em 07/03/2008 / VersÃo:  
> 5.2.00/5247
> Proteja o seu e-mail Terra: http://mail.terra.com.br/
>

--
 [ signature omitted ] 

Message 7 in thread

Rafael Roquetto wrote:
> There you are.
>
> You are lucky I found this. I didnt even think I would have it. I have
> spoken to the copyright holder and he is ok to distribute it under
> GPL. So, please make sure you use it with GPL software. This software
> you are developing is GPL, isn't it?
>   
Don't suppose there's any possibility of talking him into an LGPL 
license...?  :)

--
 [ signature omitted ] 

Message 8 in thread

No. I wonÂt use it. DonÂt worry :). I need understand how it works:  
protocol and some code. IÂll create my own class and it will be GPL too.  
After that a can give for everyone. But, now i donÂt know anything about a  
API for DDE.

Thanks a lot,
Jefferson.


Em Mon, 10 Mar 2008 13:33:43 -0300, Rafael Roquetto  
<rafaelroquetto@xxxxxxxxx> escreveu:

> There you are.
>
> You are lucky I found this. I didnt even think I would have it. I have
> spoken to the copyright holder and he is ok to distribute it under
> GPL. So, please make sure you use it with GPL software. This software
> you are developing is GPL, isn't it?
>
> You will use three methods
>
> DDEComm::getInstance();
> DEComm::ddeRequest();
> DDECom::ddeExecute();
>
> Please note these classes rely on Qt3, not Qt4. They are pretty old,
> however the only Qt class they rely on is QString. Therefore you will
> have to make the appropriate changes.
>
> Rafael
>
> On Mon, Mar 10, 2008 at 11:30 AM, Jefferson Costa
> <jsampaio123@xxxxxxxxxxxx> wrote:
>> Ok. When ? :)
>>
>>  Regars,
>>
>> Jefferson.
>>
>>  Em Sat, 08 Mar 2008 23:17:51 -0300, Rafael Roquetto
>>  <rafaelroquetto@xxxxxxxxx> escreveu:
>>
>>
>>
>> > Short answer is: no.
>>  >
>>  > I have encapsulated some DDE functionality into some C++ classes to
>>  > use with a custom version of psi some years ago. I will check if I  
>> can
>>  > still find the source and send them to you.
>>  > But basically, you will have to rely on Win32 API calls. Qt can't  
>> help
>>  > you.
>>  >
>>  > As a side note: You shouldn't be using DDE. It is pretty much an
>>  > outdated technology, even not recommended by Microsoft.
>>  >
>>  >
>>  > Regards
>>  >
>>  > On Sat, Mar 8, 2008 at 10:56 PM, Jefferson Costa
>>  > <jsampaio123@xxxxxxxxxxxx> wrote:
>>  >> Hi,
>>  >>
>>  >>  I need to implement a Client/Server DDE. Is there any way to do it
>>  >> with Qt
>>  >>  ?
>>  >>
>>  >>  Regards,
>>  >>  Jefferson.
>>  >>
>>  >>  --
>>  >>  To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx  
>> with
>>  >> "unsubscribe" in the subject or the body.
>>  >>  List archive and information:  
>> http://lists.trolltech.com/qt-interest/
>>  >>
>>  >>
>>  >
>>
>>
>> > Esta mensagem foi verificada pelo E-mail Protegido Terra.
>>  > Scan engine: McAfee VirusScan / Atualizado em 07/03/2008 / VersÃo:
>>  > 5.2.00/5247
>>  > Proteja o seu e-mail Terra: http://mail.terra.com.br/
>>  >
>>
>>
>>
>
> Esta mensagem foi verificada pelo E-mail Protegido Terra.
> Scan engine: McAfee VirusScan / Atualizado em 07/03/2008 / VersÃo:  
> 5.2.00/5247
> Proteja o seu e-mail Terra: http://mail.terra.com.br/
>


--
 [ signature omitted ] 

Message 9 in thread

Try ACE <http://www.cs.wustl.edu/~schmidt/ACE.html>

If you are working with Qt, use the QtReactor

On Mar 8, 2008, at 8:56 PM, Jefferson Costa wrote:

> Hi,
>
> I need to implement a Client/Server DDE. Is there any way to do it  
> with Qt ?
>
> Regards,
> Jefferson.
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx  
> with "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>

--
 [ signature omitted ] 

Message 10 in thread

I didnÂt see any thing about DDE (Dynamic Data Exchange) in ACE site and  
QtReactor has classes in qt3 and python.
I need a way to implement DDE in windows (My Qt is 4.2.3 open source for  
windows on a XP).

Regards,
Jefferson.

Em Sun, 09 Mar 2008 00:06:17 -0300, Dan White <ygor@xxxxxxxxxxx> escreveu:

> Try ACE <http://www.cs.wustl.edu/~schmidt/ACE.html>
>
> If you are working with Qt, use the QtReactor
>
> On Mar 8, 2008, at 8:56 PM, Jefferson Costa wrote:
>
>> Hi,
>>
>> I need to implement a Client/Server DDE. Is there any way to do it with  
>> Qt ?
>>
>> Regards,
>> Jefferson.
>>
>> --
>> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with  
>> "unsubscribe" in the subject or the body.
>> List archive and information: http://lists.trolltech.com/qt-interest/
>>
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with  
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>
> Esta mensagem foi verificada pelo E-mail Protegido Terra.
> Scan engine: McAfee VirusScan / Atualizado em 07/03/2008 / VersÃo:  
> 5.2.00/5247
> Proteja o seu e-mail Terra: http://mail.terra.com.br/
>


--
 [ signature omitted ] 

Message 11 in thread

Apologies.  I saw "Client/Server" and reacted to that.
Now that I have Googled DDE, I understand that my suggestion was  
inadequate.

Have you looked at NetDDE ?

Good luck.

On Mar 9, 2008, at 8:28 AM, Jefferson Costa wrote:

> I didn´t see any thing about DDE (Dynamic Data Exchange) in ACE  
> site and QtReactor has classes in qt3 and python.
> I need a way to implement DDE in windows (My Qt is 4.2.3 open  
> source for windows on a XP).
>
> Regards,
> Jefferson.
>
> Em Sun, 09 Mar 2008 00:06:17 -0300, Dan White <ygor@xxxxxxxxxxx>  
> escreveu:
>
>> Try ACE <http://www.cs.wustl.edu/~schmidt/ACE.html>
>>
>> If you are working with Qt, use the QtReactor
>>
>> On Mar 8, 2008, at 8:56 PM, Jefferson Costa wrote:
>>
>>> Hi,
>>>
>>> I need to implement a Client/Server DDE. Is there any way to do  
>>> it with Qt ?
>>>
>>> Regards,
>>> Jefferson.
>>>
>>> --
>>> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx  
>>> with "unsubscribe" in the subject or the body.
>>> List archive and information: http://lists.trolltech.com/qt- 
>>> interest/
>>>
>>
>> --
>> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx  
>> with "unsubscribe" in the subject or the body.
>> List archive and information: http://lists.trolltech.com/qt-interest/
>>
>>
>> Esta mensagem foi verificada pelo E-mail Protegido Terra.
>> Scan engine: McAfee VirusScan / Atualizado em 07/03/2008 / Versão:  
>> 5.2.00/5247
>> Proteja o seu e-mail Terra: http://mail.terra.com.br/
>>
>
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx  
> with "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>

--
 [ signature omitted ] 

Message 12 in thread

Hi,

> I didnÂt see any thing about DDE (Dynamic Data Exchange) in ACE site and 
> QtReactor has classes in qt3 and python.
> I need a way to implement DDE in windows (My Qt is 4.2.3 open source for 
> windows on a XP).

Actually this was a suggestion to try something else - not a link to a DDE 
wrapper.

Do you really need DDE? If so, I guess you need to communicate with a 3rd 
party program/library using DDE?

--
 [ signature omitted ] 

Message 13 in thread

Do you know any 3rd party ?

Jefferson.

Em Sun, 09 Mar 2008 09:36:00 -0300, Dimitri <dimitri@xxxxxxxxxxxxx>  
escreveu:

> Hi,
>
>> I didnÂt see any thing about DDE (Dynamic Data Exchange) in ACE site  
>> and QtReactor has classes in qt3 and python.
>> I need a way to implement DDE in windows (My Qt is 4.2.3 open source  
>> for windows on a XP).
>
> Actually this was a suggestion to try something else - not a link to a  
> DDE wrapper.
>
> Do you really need DDE? If so, I guess you need to communicate with a  
> 3rd party program/library using DDE?
>
> --
> Dimitri
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with  
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>
> Esta mensagem foi verificada pelo E-mail Protegido Terra.
> Scan engine: McAfee VirusScan / Atualizado em 07/03/2008 / Versïo:  
> 5.2.00/5247
> Proteja o seu e-mail Terra: http://mail.terra.com.br/
>


--
 [ signature omitted ]