Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Compatibilidade ActiveX
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  9 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Tiago Fucilini  
View profile   Translate to Translated (View Original)
 More options Jul 7, 3:36 pm
From: Tiago Fucilini <tiagof...@gmail.com>
Date: Tue, 7 Jul 2009 12:36:06 -0700 (PDT)
Local: Tues, Jul 7 2009 3:36 pm
Subject: Compatibilidade ActiveX
Olá,

desenvolvi um controle activfeX em vc++ atl e preciso usar ele em
outras linguagem como delphi e vb. A maior parte das coisas funciona,
o problema esta na hora de passar algum parametro do tipo string,
creio que seja por cada linguagem tratar de um modo diferente as
cadeias de caracteres. O meu controle está preparado para receber um
BSTR.

Uma coisa que achei estranha é a seguinte: se eu usar o meu componente
no vb e mandar a string diretamente ex:

controle.nome = "controle"

funciona, já se eu tentar pegar o texto de um textbox não. ex:

controle.nome = textbox.text

alguem sabe como resolver esse problema.

Tiago Fucilini


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paulo Rogério Panhoto  
View profile   Translate to Translated (View Original)
 More options Jul 7, 4:01 pm
From: Paulo Rogério Panhoto <pa...@voicetechnology.com.br>
Date: Tue, 07 Jul 2009 17:01:26 -0300
Local: Tues, Jul 7 2009 4:01 pm
Subject: Re: [ccppbrasil] Compatibilidade ActiveX
So por curiosidade, você poderia definir o que é "não funciona"? É um
erro no VB? A sua rotina não é chamada? Ou ela é chamada e o valor que
vem pra ela vem diferente do que você esperava?


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Wellington  
View profile   Translate to Translated (View Original)
 More options Jul 7, 4:08 pm
From: Wellington <equ...@desenvolvendosites.com>
Date: Tue, 07 Jul 2009 17:08:52 -0300
Local: Tues, Jul 7 2009 4:08 pm
Subject: Re: [ccppbrasil] Compatibilidade ActiveX
Tiago,

Se me recordo de vb6, seria algo +/- assim

controle.nome = CStr(textbox.text)

A função CStr() converte o conteudo para string.

Espero que possa lhe ajudar

Abraços


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tiago Fucilini  
View profile   Translate to Translated (View Original)
 More options Jul 7, 5:14 pm
From: Tiago Fucilini <tiagof...@gmail.com>
Date: Tue, 7 Jul 2009 18:14:45 -0300
Local: Tues, Jul 7 2009 5:14 pm
Subject: Re: [ccppbrasil] Re: Compatibilidade ActiveX

Paulo,
o não funciona, quer dizer que a string não é passada e sim algum lixo ou
outra coisa.

Wellington
jah tentei converter explicitamente que nem no seu exemplo e não ajudou.

2009/7/7 Paulo Rogério Panhoto <pa...@voicetechnology.com.br>


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rodrigo Strauss  
View profile   Translate to Translated (View Original)
 More options Jul 7, 11:48 pm
From: Rodrigo Strauss <rodr...@1bit.com.br>
Date: Wed, 8 Jul 2009 00:48:07 -0300
Local: Tues, Jul 7 2009 11:48 pm
Subject: Re: [ccppbrasil] Compatibilidade ActiveX
Sem o trecho de código da atribuição fica difícil... Coloque o trecho
C++ e o trecho VB.

Não funcionou == ??

Qual o erro? Você recompilou a aplicação VB que usa o seu componente ATL?

Não precisa de CStr não, a atribuição direta deveria funcionar já que
é tudo BSTR.

Rodrigo Strauss
http://www.1bit.com.br

2009/7/7 Tiago Fucilini <tiagof...@gmail.com>:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Caloni  
View profile   Translate to Translated (View Original)
 More options Jul 8, 8:11 am
From: Caloni <wanderleycal...@gmail.com>
Date: Wed, 8 Jul 2009 05:11:23 -0700 (PDT)
Local: Wed, Jul 8 2009 8:11 am
Subject: Re: Compatibilidade ActiveX
Aproveite e mande-nos a definição da interface com os atributos IDL
dos parâmetros.

On Jul 8, 12:48 am, Rodrigo Strauss <rodr...@1bit.com.br> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tiago Fucilini  
View profile   Translate to Translated (View Original)
 More options Jul 8, 9:29 am
From: Tiago Fucilini <tiagof...@gmail.com>
Date: Wed, 8 Jul 2009 10:29:30 -0300
Local: Wed, Jul 8 2009 9:29 am
Subject: Re: [ccppbrasil] Re: Compatibilidade ActiveX

Trecho do componente em c++:
STDMETHODIMP CIDataBase::put_StringDeConexao(BSTR newVal)
{
    USES_CONVERSION;
    cnnString = OLE2A(newVal);
    propriedades[2]=true;
    return S_OK;

}

Trecho da interface para a propriedade StringDeConexão:
[propput, id(6), helpstring("property StringDeConexao")] HRESULT
StringDeConexao([in] BSTR newVal);

Trecho em VB:
Private Sub InicializarBancoButtom_Click()
    StringConexaoText.Text = "driver={Microsoft Access Driver
(*.mdb)};dbq=[\\10.1.1.19\TiagoTestes\Banco.mdb];Uid=Administrador;Pwd=xxxx xx"
    Set base = New BioToolsLib.CIDataBase
    base.StringDeConexao = StringConexaoText.Text
End Sub

Ai está os trechos de codigo. Debugando a aplicação no vb a
StringConexaoText recebe o valor correto ja a base.StringDeConexão recebe
uns caracteres invalidos.

2009/7/8 Caloni <wanderleycal...@gmail.com>


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tiago Fucilini  
View profile   Translate to Translated (View Original)
 More options Jul 8, 6:19 pm
From: Tiago Fucilini <tiagof...@gmail.com>
Date: Wed, 8 Jul 2009 19:19:06 -0300
Local: Wed, Jul 8 2009 6:19 pm
Subject: Re: [ccppbrasil] Re: Compatibilidade ActiveX

Conseguir resolver o problema, ele estava na funcao get e não na put da
propriedade. Resolvi usando a funcão SysReAllocString. em vez de atribuir
diretamente.

2009/7/8 Tiago Fucilini <tiagof...@gmail.com>


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rodrigo Strauss  
View profile   Translate to Translated (View Original)
 More options Jul 14, 9:41 pm
From: Rodrigo Strauss <rodr...@1bit.com.br>
Date: Tue, 14 Jul 2009 22:41:10 -0300
Local: Tues, Jul 14 2009 9:41 pm
Subject: Re: [ccppbrasil] Re: Compatibilidade ActiveX
Se entendi bem, você estava devolvendo sua BSTR interna no get. O VB
desaloca sua BSTR automagicamente, já que pelas regras do COM é isso
que ele deveria fazer.

Sempre que um parâmetro for [out,retval], você deve devolver uma cópia
e o "chamador" deve desalocar.

Rodrigo Strauss
http://www.1bit.com.br

2009/7/8 Tiago Fucilini <tiagof...@gmail.com>:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google