Adobe Dreamweaver Forums



Last 10 THreads :         Javahelp/Oracle Help (Last Post : cindys@ddms.com - Replies : 10 - Views : 11 )           »          Refreshing xml data in flex (Last Post : ntsiii - Replies : 1 - Views : 4 )           »          move tab with embedded image (Last Post : VPI MkIII - Replies : 1 - Views : 2 )           »          DataGrid CheckBox ItemRenderer (Last Post : fccobb - Replies : 0 - Views : 1 )           »          Passing variable between components (Last Post : ntsiii - Replies : 2 - Views : 3 )           »          CS3 - Export/Save as vector file??? (Last Post : JoshB20 - Replies : 8 - Views : 9 )           »          CF8 Help in Dreamweaver CS3 (Last Post : A.J.cfm - Replies : 2 - Views : 3 )           »          css for partial page border? (Last Post : Murray *ACE* - Replies : 1 - Views : 2 )           »          uploading site (Last Post : Murray *ACE* - Replies : 5 - Views : 6 )           »          FlashVars help (Last Post : Cgull - Replies : 3 - Views : 4 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Other Macromedia/Adobe Products > Flex
 
Tags:



Reply
  #1 (permalink)  
Old 10-03-2008, 06:17 AM
namala
 
Posts: n/a
Diggs:
Default Flex and C++

Hi Every One,

I have two applications ,among them one will be flex
and the other one is C++ application, Flex will be the front end application ,
When i click the button in the front end parameters must be transferred from
flex to C++ and it should process there and it should returned to flex. I want
to use Server also (Tomcat 5.5) .How to do this???

Thanks in advance........



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-03-2008, 06:54 AM
ice9_us
 
Posts: n/a
Diggs:
Default Re: Flex and C++

i have done this by using the httpservice...
i wrote inside my c app a listen function..
that is the only way i know of at this time.

the httpservice connects to my port..
i parse the data... and kick back xml data which is read into an array or
xmllist...

do you have any idea how to change the color of a datagrid background based on
text in the data you get back?

httpservice -> get data..

if rowdata == someline of data ){
set background black
else if ( rowdata == someline of data) {
set background blue.....




Reply With Quote
  #3 (permalink)  
Old 10-03-2008, 07:13 AM
tiaan.wessels
 
Posts: n/a
Diggs:
Default Re: Flex and C++

I presume you know how to to socket communications in C. The simplest of
patterns for this scenario is setup a security policy server on port 843
(default Flash policy server port - see Flash security white paper). Setup a
listening socket on some other port of your own choice which will accept TCP/IP
connections. Use flash.net.Socket to connect to your server socket. When you do
this, flash will transparently connect to port 843 first. Your program should
now serve it with a zero terminated XML file according to the cross-domain
policy XML format. Provided this file is correctly setup, the flash player will
now proceed to connect to your actual TCP/IP port. You may now exchange data as
you wish. In my opinion, easiest is 4 byte number in network byte order
indicating length of payload to follow and then the payload in XML (you need an
external data format - XML easiest in Flex as it is really geared towards this
but you might want to have a look at Adobe ADF as well if bandwidth is a
problem). In your C app, read the 4byte length and then so many bytes
thereafter, parse the XML, do something useful and return the answer in XML
which you can now hand over to the top-level XML class for inspection in your
Flex app.
Hope you come right.

Reply With Quote


  #4 (permalink)  
Old 10-10-2008, 09:41 AM
namala
 
Posts: n/a
Diggs:
Default Re: Flex and C++

Can u give me the sample code please...........
Reply With Quote
  #5 (permalink)  
Old 10-10-2008, 09:41 AM
tiaan.wessels
 
Posts: n/a
Diggs:
Default Re: Flex and C++

I'm sorry but i don't have a self-contained example and am buried under work so it might take a while to concoct up something. Which part are you referring to, the C or Flex part or both ?
Reply With Quote
  #6 (permalink)  
Old 10-29-2008, 08:13 PM
ice9_us
 
Posts: n/a
Diggs:
Default Re: Flex and C++

Sorry i just saw this or i would have posted sample code long ago..
Let me know if you need anything else..
when you accept a connection you call simple read/write functions to pass
data...
I am more than happy to help..



int main(int argc, char **argv) {

FILE *fp;
int listenfd, connfd, n, status ;
const int on = 1;
pid_t childpid;
pid_t parent;
socklen_t clilen;

struct sockaddr_in cliaddr, servaddr;

buff2=malloc(512);
host_connect=malloc(14);

listenfd = socket(AF_INET, SOCK_STREAM, 0);
bzero(&servaddr, sizeof(servaddr));
servaddr.sin_family = AF_INET;
servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
servaddr.sin_port = htons(Put your port number here);

setsockopt(listenfd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
setsockopt(listenfd, SOL_SOCKET, TCP_NODELAY, &on, sizeof(on));

bind(listenfd, (struct sockaddr *) &servaddr, sizeof(servaddr));
listen(listenfd, 300);


/** When testing network stuff here.. use UNIX telnet stuff.. some apps are
sending extra data...
this is the reason you see me check for the # of data waiting to be
read before i even start working...
I also have functions which check for buffer over flow attacks and other
types of hacks...
***/

if ( ( parent = fork()) == 0 ) {
for ( ; ; ) {
clilen = sizeof(cliaddr);
if ( (connfd = accept(listenfd, (struct sockaddr *) &cliaddr,
&clilen)) < 0 ) {
if ( errno == EINTR ) {
continue;
} else {
perror("accept");
}
}

Reply With Quote


  #7 (permalink)  
Old 10-29-2008, 08:13 PM
ice9_us
 
Posts: n/a
Diggs:
Default Re: Flex and C++

/** When testing network stuff here.. use UNIX telnet stuff.. some apps are
sending extra data...
this is the reason you see me check for the # of data waiting to be read
before i even start working...
I also have functions which check for buffer over flow attacks and other types
of hacks...
***/

--------------------------------------------------------------------------------
----------------------------
you don't see this take place.. i did a cut and P. of some of my basic stuff
to get ya going..
if you need any more help let me know.. I will be more than happy do do
anything i can..

I am very sorry i didn't see this post until now..

Reply With Quote
  #8 (permalink)  
Old 10-31-2008, 06:23 PM
namala
 
Posts: n/a
Diggs:
Default Re: Flex and C++

Can u give me the sample code please...........
Reply With Quote
  #9 (permalink)  
Old 10-31-2008, 06:23 PM
tiaan.wessels
 
Posts: n/a
Diggs:
Default Re: Flex and C++

I'm sorry but i don't have a self-contained example and am buried under work so it might take a while to concoct up something. Which part are you referring to, the C or Flex part or both ?
Reply With Quote


  #10 (permalink)  
Old 10-31-2008, 06:25 PM
namala
 
Posts: n/a
Diggs:
Default Re: Flex and C++

Can u give me the sample code please...........
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 06:15 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Cheap Car Insurance - Compare Motor Insurance
Endsleigh Car Insurance Natwest Car Insurance
More Than Car Insurance Norwich Union Car Insurance
Prudential Car Insurance Zurich Car Insurance
Inactive Reminders By Mished.co.uk