How convert Windows C++ code to Linux?

How convert Windows C++ code to Linux code?

Thanks,
Maybe someone can convert this simple windows code to linux:
PlaySoundA("a.wav", NULL, SND_FILENAME | SND_ASYNC);
or this:
char b[999999];
WAVEFORMATEX wfex;HWAVEOUT hwo;
HMMIO m_hmmio; // MM I/O handle for the WAVE
MMCKINFO m_ck; // Multimedia RIFF chunk
MMCKINFO m_ckRiff; // Use in opening a WAVE file
DWORD m_dwSize=0; // The size of the wave file
WAVEHDR whdr;
HANDLE hDoneEvent = CreateEventA(NULL, FALSE, FALSE, "DONE_EVENT");
wfex.wFormatTag = WAVE_FORMAT_PCM;
wfex.nChannels = 1;
wfex.nSamplesPerSec = 22050;
wfex.nAvgBytesPerSec = 44100;
wfex.nBlockAlign = 2;
wfex.wBitsPerSample = 16;
waveOutOpen(&hwo, WAVE_MAPPER, &wfex,(DWORD) hDoneEvent, 0,CALLBACK_EVENT);
m_hmmio = mmioOpen("a.wav", NULL, MMIO_ALLOCBUF | MMIO_READ );
MMCKINFO ckIn; // chunk info. for general use.
mmioDescend( m_hmmio, &m_ckRiff, NULL, 0 );
mmioDescend( m_hmmio, &ckIn, &m_ckRiff,MMIO_FINDCHUNK );
mmioSeek( m_hmmio, m_ckRiff.dwDataOffset + sizeof(FOURCC),SEEK_SET );
m_ck.ckid = mmioFOURCC('d', 'a', 't', 'a');
mmioDescend( m_hmmio, &m_ck, &m_ckRiff,MMIO_FINDCHUNK );// )
m_dwSize =m_ck.cksize;
MMIOINFO mmioinfoIn; // current status of m_hmmio
mmioGetInfo( m_hmmio, &mmioinfoIn, 0 );
for(DWORD cT=0;cT<m_dwSize;cT++) {
if(mmioinfoIn.pchNext==mmioinfoIn.pchEndRead) {
mmioAdvance( m_hmmio, &mmioinfoIn, MMIO_READ );
*((BYTE*)b+cT)=*((BYTE*)mmioinfoIn.pchNext);
mmioinfoIn.pchNext++;
mmioClose(m_hmmio,0);
ZeroMemory(&whdr, sizeof(WAVEHDR));
whdr.lpData=b;
whdr.dwBufferLength =m_dwSize;
waveOutPrepareHeader(hwo, &whdr, sizeof(WAVEHDR));
waveOutWrite(hwo, &whdr, sizeof(WAVEHDR));
while (!(whdr.dwFlags & WHDR_DONE)) {
WaitForSingleObject(hDoneEvent, INFINITE);
waveOutUnprepareHeader(hwo, &whdr, sizeof(WAVEHDR));
waveOutClose(hwo);
But I use Quincy (http://codecutter.net/tools/quincy/)with Wine  and creating that .exe files.
Quincy not create  'makefile' (I not understand why me need 'makefile' edit and from were I can get it?) files, it create 'filename.o' files only.
And I understoond, then read Wine text, that with Wine (http://www.winehq.com/) possible convert Windows code to Linux, but do not known how.
How convert Windows code to Linux with Wine?

Similar Messages

  • Convert Window Oracle 10g to Linux Oracle 11g

    HI Experts
    My current version is Oracle 10g on Window and i want to convert on Oracle 11g on Linux.
    What will be the best way to convert it ? can possible to direct convert
    or i need to be database migration from window Oracle 10g to Linux Oracle 10g and then covert from Linux Oracle 10g to Linux Oracle 11g.
    If the direct conversion is possible then please let me know the way or if u have document then please share it.
    I searched lot but i didn't get anything.....
    Thanks in advance

    What is the expected downtime duration ?
    What is the database size ?
    For a "small" database with no downtime constraint you could use Data Pump to move data.
    For a "large" database with minimum downtime you could use Oracle Streams (with Enterprise Edition) or Golden Gate (separate product: needs new licensing).
    You can find detailed migration/upgrade recommendations and scenarios on OTN database upgrade page:
    http://www.oracle.com/technetwork/products/upgrade/index.html
    Edited by: P. Forstmann on 22 mars 2013 13:03

  • Convert Below Java code equivalent to c# windows store app.

    Hi
    please help me " To convert Below Java code equivalent to c# windows store app."
    private String SecretKey = "enctsbqrm6hxyjfa";
        public byte[] encrypt(String text) throws Exception
            if(text == null || text.length() == 0)
                throw new Exception("Empty string");
            // convert key to bytes
            byte[] keyBytes = SecretKey.getBytes("UTF-8");
            // Use the first 16 bytes (or even less if key is shorter)
            byte[] keyBytes16 = new byte[16];
            System.arraycopy(keyBytes, 0, keyBytes16, 0, Math.min(keyBytes.length, 16));
            // convert plain text to bytes
            byte[] plainBytes = text.getBytes("UTF-8");
            // setup cipher
            SecretKeySpec skeySpec = new SecretKeySpec(keyBytes16, "AES");
            Cipher cipher = Cipher.getInstance("AES/ECB/PKCS7Padding");
            //byte[] iv = new byte[16]; // initialization vector with all 0
            cipher.init(Cipher.ENCRYPT_MODE, skeySpec);
            // encrypt
            byte[] encrypted = cipher.doFinal(plainBytes);
            return encrypted;
      Thanks            
      Nitin

    Hello Nitin,
    Your current requirement is beyond the scope of our support for this fourm which is used to Discuss and ask questions about .NET Framework Base Classes (BCL) such as Collections, I/O, Regigistry, Globalization, Reflection.
    If you want to know how to encrypt/decrypt in windows store app, I suggest that you could post a it to:
    https://social.msdn.microsoft.com/Forums/windowsapps/en-US/home?forum=winappswithcsharp
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How convert to below lab window ansi c program in to labview

    hi
    here how convert  to below lab window ansi c program in to labview program ,please find any body sollution for this problem.
    Attachments:
    Template.c ‏8 KB
    Template.uir ‏13 KB

    Instead of starting with old c code -- which is likely only marginally useful anyways -- you should start with program requirements.
    What does the program do? What are the operational constraints? You know, all the usual stuff.
    Mike
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Where to download and how to install X Window System for Oracle Linux 5 ?

    Folks,
    Hello. I am using Oracle Linux 5 and Oracle Database 11g for PIA.
    Before install Oracle DB 11g into Oracle Linux 5, we need to install X Window System according to the document page 2 http://download.oracle.com/docs/cd/B28359_01/install.111/b32285.pdf
    But I don't know where to download and how to install X Window System for Oracle Linux 5.
    Can any folk provide a link to download X Window System and tutorial to install it for Oracle Linux 5 ?

    You can address the problem in a number of different ways.
    You can install X-windows from the installation DVD or setup access to the Oracle public software repository as described in http://public-yum.oracle.com. In which case, the command to install X-windows is: yum groupinstall "X Window System"
    Or, you login remotely and and use SSH with X-forwarding, in which case the software on the server will use the X-Windows server on your client system. This is probably the preferred way since you do not have X-windows installed on the server. For more details about SSH forwarding and howto, please see Install Oracle 11gR2 on Ubuntu Linux 11.04 (64-bit) Howto part 2 Oracle Universal Installer.

  • Dynpro application: how to perform some  code when user click window close

    Hello,
    I'm developing dynpro application. This application needs to perform some code when exiting.
    I can do that with MODULE xxxxx AT EXIT-COMMAND. But this code can't be performed when user of application click on button closing window (classic R/3 window, not pop-up).
    Does anybody know how to bind some code to clicking on button closing window?
    Best regards,
    Josef Motl

    As far as the prompt that you get when you close the last window is coming from the counter that SAP maintains regarding the number of open sessions(windows). When this counter reaches 1, I guess they have a check to issue a prompt. There was a discussion in this forum a long time back regarding how we can know that session id like SM04. There was no conclusion reached then. Theoritically, let us know you know this id for the session in which the user opened a particular page, then you can see if that session is deleted and then take the necessary action. There are some TH_* function modules that seem to be promising, but I was not able to conclusively achieve the control over a particular session.
    See if you can look at SM04 and get an idea. Please do let us know if you find the solution.
    Srinivas

  • How to install OBIA on windows having OBIEE on Linux?

    Hi,
    I am going to install as many components on Linux as possible for BI Apps.
    Presently I have installed OBIEE 11.1.1.7 on Linux 5.8 64bit.
    Now I want to install OBIA 7964 which is only available for Windows so far.
    How I can setup OBIA on Linux? May be I have to install it windows and move metadata (RPD, Catalog) on Linux.
    But again when I try to install OBIA on windows then it ask for OBIEE software locations (Like domain home, instance home etc)
    Does that interesting by Oracle? How to solve it?
    Documentation say nothing about it.
    Regards
    Naeem Akhtar

    After you have copied you might just need to restart the services for few files in order for them to be reflected. OBIA comes with RPD and catalog folders, just copy them or deploy them using EM and just restart the services. You should be good.
    If you cant access http://hostname:9704/analytics then services might be down. looks for logs and also ./opmnctl status to see as what are the services are down.
    Thanks,
    RM

  • Converting Windows Icons, how?

    Hey there...
    Does anyone know how to change windows icons to os x? I use a white PSP on my Mac and have finally managed to find a white psp icon to match the only thing is that it's in png format and I can't do the usual copy and paste from Get Info. Does anyone know how to convert these icons? Or does anyone know where I can get a white psp icon for the Mac? Thanks!

    Hi, Tymon.
    Graphic Converter can convert Windows ICO/ICN formats and PNG files to Apple Apple icon formats. Use the File > Convert & Modify option, select Convert in the Function pop-up menu, navigate to and select the files you want to convert in the left pane, select where they're to be saved in the right pane, select the desired Apple icon format in the Dest. Format pop-up menu, and you should be good-to-go.
    Good luck!
    Dr. Smoke
    Author: Troubleshooting Mac® OS X

  • How do you convert windows programs to imac

    how do you convert windows program downloads to your imac

    You need to use a tool which enables them to be run on the iMac, such as CrossOver Mac, VirtualBox, or Boot Camp.
    (66074)

  • How Do I Convert Windows 10 Pro Technical Preview to Windows 10 Enterprise Technical Preview and Back Without Reinstalling Windows?

    Howdy,
    Much like in Windows 8 and Windows 8.1, Windows 10 provides you with experience that allows you to convert your Windows 10 Pro Technical Preview to Windows 10 Enterprise Technical Preview without having to reinstall Windows.
    Why would I need converting my Windows SKU (edition)
    Currently, you may need this to fix issues with Windows not synchronizing browser favorites between different editions. For example, if you're using Windows 10 Enterprise Technical Preview in a test environment at work and Windows 10 Pro Technical
    Preview at home, you won't see favorites added on Enterprise edition at home and vice versa. All the links added on Pro edition while browsing web at home won't appear on your work PC.
    To convert Windows 10 Pro Technical Preview to Windows 10
    Enterprise Technical Preview:
    1. Press WindowsKey+PauseBreak and select Add Windows Features at the bottom left corner of System window.
    2. In the Add features to <OSName> window click to add Product key and type in the
    public product key for Windows 10 Enterprise Technical Preview available here.
    Voila! Your Windows 10 Pro Technical Preview is now converted to Windows 10 Enterprise Technical Preview.
    To convert Windows 10 Enterprise Technical Preview to Windows 10 Pro Technical Preview:
    Following the above procedure does NOT reveal Add features to Windows 10 link button in System window.
    We could try doing this through DISM tool.
    1. Press WindowsKey+X and select Windows PowerShell (Admin) or Command Prompt (Admin).
    2. At the command prompt type dism /online /Get-CurrentEdition to obtain information about the current edition of Windows:
    PS C:\Windows\system32> dism /online /Get-CurrentEdition
    Deployment Image Servicing and Management tool
    Version: 10.0.9926.0
    Image Version: 10.0.9926.0
    Current edition is:
    Current Edition : Enterprise
    The operation completed successfully.
    PS C:\Windows\system32>
    3. Check which versions you may switch to:
    PS C:\Windows\system32> dism /online /Get-TargetEditions
    Deployment Image Servicing and Management tool
    Version: 10.0.9926.0
    Image Version: 10.0.9926.0
    Editions that can be upgraded to:
    (The current edition cannot be upgraded to any target editions.)
    The operation completed successfully.
    Looks like Windows 10 Enterprise Technical Preview cannot be downgraded.
    To downgrade edition from Enterprise to Pro, you can trick Windows setup into thinking it is running on Pro by going to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion and changing the following keys:
    Windows Registry Editor Version 5.00
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion]
    "EditionID"="Enterprise"
    "ProductName"="Windows 10 Enterprise Technical Preview"
    I believe for Pro edition this must be
    Windows Registry Editor Version 5.00
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion]
    "EditionID"="Professional"
    "ProductName"="Windows 10 Pro Technical Preview"
    After that you may run in-place upgrade using Windows 10 Pro Technical Preview Setup disc.
    Note, if you can't find the Add features to option in Control panel, press Windows Key + R and type control /name Microsoft.WindowsAnytimeUpgrade.
    If you want to, you could change Windows edition via DISM servicing tool by running:
    DISM /online /Set-Edition:Enterprise /ProductKey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX /AcceptEula
    In case you can't access official page for
    Windows 10 Enterprise Technical Preview download, or the page that contains
    product key for Windows 10 Pro Technical Preview, you can always obtain the product key by looking for
    F:\sources\pid.txt on the Windows Setup disc.
    Well this is the world we live in And these are the hands we're given...

    Howdy,
    Much like in Windows 8 and Windows 8.1, Windows 10 provides you with experience that allows you to convert your Windows 10 Pro Technical Preview to Windows 10 Enterprise Technical Preview without having to reinstall Windows.
    Why would I need converting my Windows SKU (edition)
    Currently, you may need this to fix issues with Windows not synchronizing browser favorites between different editions. For example, if you're using Windows 10 Enterprise Technical Preview in a test environment at work and Windows 10 Pro Technical
    Preview at home, you won't see favorites added on Enterprise edition at home and vice versa. All the links added on Pro edition while browsing web at home won't appear on your work PC.
    To convert Windows 10 Pro Technical Preview to Windows 10
    Enterprise Technical Preview:
    1. Press WindowsKey+PauseBreak and select Add Windows Features at the bottom left corner of System window.
    2. In the Add features to <OSName> window click to add Product key and type in the
    public product key for Windows 10 Enterprise Technical Preview available here.
    Voila! Your Windows 10 Pro Technical Preview is now converted to Windows 10 Enterprise Technical Preview.
    To convert Windows 10 Enterprise Technical Preview to Windows 10 Pro Technical Preview:
    Following the above procedure does NOT reveal Add features to Windows 10 link button in System window.
    We could try doing this through DISM tool.
    1. Press WindowsKey+X and select Windows PowerShell (Admin) or Command Prompt (Admin).
    2. At the command prompt type dism /online /Get-CurrentEdition to obtain information about the current edition of Windows:
    PS C:\Windows\system32> dism /online /Get-CurrentEdition
    Deployment Image Servicing and Management tool
    Version: 10.0.9926.0
    Image Version: 10.0.9926.0
    Current edition is:
    Current Edition : Enterprise
    The operation completed successfully.
    PS C:\Windows\system32>
    3. Check which versions you may switch to:
    PS C:\Windows\system32> dism /online /Get-TargetEditions
    Deployment Image Servicing and Management tool
    Version: 10.0.9926.0
    Image Version: 10.0.9926.0
    Editions that can be upgraded to:
    (The current edition cannot be upgraded to any target editions.)
    The operation completed successfully.
    Looks like Windows 10 Enterprise Technical Preview cannot be downgraded.
    To downgrade edition from Enterprise to Pro, you can trick Windows setup into thinking it is running on Pro by going to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion and changing the following keys:
    Windows Registry Editor Version 5.00
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion]
    "EditionID"="Enterprise"
    "ProductName"="Windows 10 Enterprise Technical Preview"
    I believe for Pro edition this must be
    Windows Registry Editor Version 5.00
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion]
    "EditionID"="Professional"
    "ProductName"="Windows 10 Pro Technical Preview"
    After that you may run in-place upgrade using Windows 10 Pro Technical Preview Setup disc.
    Note, if you can't find the Add features to option in Control panel, press Windows Key + R and type control /name Microsoft.WindowsAnytimeUpgrade.
    If you want to, you could change Windows edition via DISM servicing tool by running:
    DISM /online /Set-Edition:Enterprise /ProductKey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX /AcceptEula
    In case you can't access official page for
    Windows 10 Enterprise Technical Preview download, or the page that contains
    product key for Windows 10 Pro Technical Preview, you can always obtain the product key by looking for
    F:\sources\pid.txt on the Windows Setup disc.
    Well this is the world we live in And these are the hands we're given...

  • How to convert these java codes (for a feedback) to javabean?

    Can anyone please help me to convert these java codes (for feedback) to javabean using the MVC Model-View-Controller pattern design?
    <%
    //instantiate variables
    Connection con = null;
    Statement stmt = null;
    Statement stmt2 = null;
    ResultSet rs = null;
    String queryString;
    int newInBoxMsg = 0;
    int newSentMsg = 0;
    int newSavedMsg = 0;
    int newTrashCanMsg = 0;
    String currentUserID = 1+"";
    String adminID = 1+""; //change this ID to your adminID in the db
    try
    //Load the JDBC driver
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
    //Get the connection getConnection("access driver", "userID", "password")
    con = DriverManager.getConnection("jdbc:odbc:FREN_DB","","");
    stmt = con.createStatement();
    //sql statements: create, update, query
    Calendar cl = Calendar.getInstance();
    %>
    <%
    if(request.getMethod()=="POST"){
                   int y = stmt.executeUpdate("INSERT into Feedback(`whom`, `msg`, `date`)"
                   +" values ('"+currentUserID+"', '"+request.getParameter("date")+"', '"
                   request.getParameter("msg")"')");
                   int x = stmt.executeUpdate("INSERT into MailBox(`whom`, `who`, `mailheader`, `mailbody`, `date`)"
                   +" values ('"+adminID+"', '"+currentUserID+"', 'Feedback', 'We have received your feedback and we will respond to you as soon as possible', '"+request.getParameter("date")+"')");
                   out.println("Feedback Sent!");
    else {
    %>
    <form name="compose" method="POST" action="Feedback.jsp">
    <input name="date" type="hidden" value="<% out.println(cl.get(cl.DAY_OF_MONTH)+"/"+cl.get(cl.MONTH)+"/"+cl.get(cl.YEAR)); %>" maxlength="20">
    <p>Your Feedback</p>
    <p>
    <textarea name="msg" cols="50" rows="10"></textarea>
    </p>
    <p>
    <input type="submit" name="Submit" value="Submit">
    </p>
    </form>
    <%
    }catch(Exception e) {
    System.out.println(e);
    %>

    Okay, first suggestion is to never create database connections in JSP/Servlet. SInce you mentioned MVC, JSP is the View, and a servlet can be the controller to process requests and redirect accordingly.
    This piece of code should be in a class invoked from the model layer (business logic components) preferably with some abstraction. Maybe you should search around for DAO pattern. That might give you an idea.

  • How to convert a VB code(Comm1.Output=Chr$(7)+"R"+Chr$(13)) to labview code

    Hi,
    I have a question about serial communication.
    The code was written by VB, and I want to transform them to labview.
    One of the code in VB is: Comm1.Output=Chr$(7)+"R"+Chr$(13), it means 'bell+R+carriage return' were sent to com1 port.
    But I don't know how to write this code in labview.
    Could anyone help me?
    Great thanks

    Hi cctt126,
    I would recommend you re-post this question in either the LabVIEW forum or the GPIB/Serial forum. Those forums are much more active and more likely to get you a response. Also, since VB is a less commonly used language and there’s probably not a direct translation into LabVIEW, you might provide more of a description of what you are trying to accomplish with your code. Thanks!
    That said, LabVIEW has several built-in examples for serial communication that should help you get started. You can find them by navigating to Help>>Find Examples in LabVIEW, then Hardware Input and Output>>GPIB. If you don’t have the NI-VISA driver installed (or if you installed LabVIEW after installing the driver) the examples may not show up.
    Regards,
    Kelsey Johnson
    Applications Engineer
    National Instruments

  • How to find Transaction code from Report/program name ?

    Dear all,
    How to find Transaction code if i know Report/program name ?

    Hi,
    In se 38 when u open ur program,in the application toolbar u have a button beside the where-used list button as display object list.on clicking this button,a window will be opened at the left most corner for repository browser,in this u can find any tranasctions,fileds,screens,dictionary structures defined for the program.
    if any transaction is created for the program u can find it under the transaction folder.
    revert back for further queries.
    Regards,
    Sravanthi

  • I wanted to install windows for Mac and I had vista so I put I the disk and installed it then it  loses my  computer wen I turned it on it went straight to windows and it asked me to install it and put in the windows box code I found out I didn't have Ma.

    I wanted to install windows for Mac and I had vista so I put I the disk and installed  followed the steps it then it  closed my  computer wen I turned it on it went straight to windows and it asked me to install it and put in the windows box code I found out I didn't have it so I wanted to go back to Mac I shut it off and it just goes back to windows and asks me to put the box code how do I get rid of it and go back to Mac because no buttons work at the start and i can't take out the disk !! Help

    The two other posts are correct... so I'll just clarify.  What's happening right now is your system is trying to boot into Windows in order to finish the installation.  What you want to do is make it boot into OS X.  As mende1 indicated, with your system off, hold down the Option key and continue to hold it while you turn the system on.  You will eventually be presented with an option to select which partition you would like to boot from.  Choose OS X.  After you get into OS X, again, as mende1 indicated, change the Startup Disk to OS X.  What this will do is cause your system to automatically boot into OS X when you restart it instead of you having to use the Option key when booting each time.
    Relaunching BootCamp Assistant will allow you to remove your Windows installation and partition. 

  • ColdFusion 11: cfclient ... how does normal CFML code and cfclient code interact?

    G'day:
    I am reposting this from my blog ("ColdFusion 11: ... how does normal CFML code and  code interact?") at the suggestion of Adobe support:
    @dacCfml @ColdFusion Can you post your queries at http://t.co/8UF4uCajTC for all cfclient and mobile queries.— Anit Kumar Panda (@anitkumar85) April 29, 2014
    I have edited this in places to remove language that will be deemed inappropriate by the censors here. Changes I have made are in [square brackets]. The forums software here has broken some of the styling, but so be it.
    G'day:
    Another quick one. I'm raising these quick-fire questions here because Adobe have declined to suggest a better place to raise them, other than as comments on one of their blog entries. Well that was Ram's suggestion (which I don't think is terribly-well thought out). He declined to react to my suggestion that the Adobe ColdFusion forums might be a good place. Anit suggested Twitter or just emailing him, but I think there'd be public interest in this stuff, so don't want to resort to email.
    As I'm the master of what goes on on this blog: I'll clutter this thing up.
    Say I want to have a mix of "normal" CFML and <cfclient>-based CFML in the same file. I can only presume the intent is to allow this, otherwise having <cfclient> as a tag rather than just a file extension seems like a poor approach. Obviously if one can have a start tag and an end tag, then code can come before (and I guess after) the <cfclient> tags themselves.
    So I'd expect this to work:
    <cfset message = "G'day World"> <cfclient> <cfoutput>#message#</cfoutput> </cfclient>
    However all I get is an error in JS:
    Uncaught ReferenceError: message is not defined variablesScopeVariable.cfm:4
    And, indeed, the only mention of message in the JS source is the one that's erroring (as it's on the right-hand side of an assignment).
    So I thought perhaps <cfclient> worked like <cfthread> and I needed to pass attributes into it:
    <cfset message = "G'day World"> <cfclient message="#message#"> <cfoutput>#message#</cfoutput> </cfclient>
    This doesn't compile:
    Attribute validation error for the client tag.
    The tag does not have an attribute called message. The valid attribute(s) are ''.
    ColdFusion cannot determine the line of the template that caused this error.This is often caused by an error in the exception handling subsystem.
    Note also there's an error in the error message itself. It's not the <client> tag, it's the <cfclient> tag.
    Rightio then, so I tried just using the request scope instead (the code's the same as the variables-scoped example, except using the request scope). No dice: same JS error.
    As a last ditch effort, I just tried to see if <cfclient> was aware of anything going on around it, by passing a value on the URL, and seeing if <cfclient> saw that, eg:
    <cfclient> <cfoutput>#URL.message#</cfoutput> </cfclient>
    This behaved differently from the variables- / request- scoped examples, in that I didn't get a JS error, I just got this on the screen:
    undefined
    And no JS error. It pains me to have to do this, but let's look at the generated JS to see why the behaviour is different:
    Variables scope example:
    <script type="text/javascript" src="/CFIDE/cfclient/cfclient_main.js"></script> <script type="text/javascript" src="/CFIDE/cfclient/cffunctions.js"></script> <meta name="viewport" content="width=device-width"> <script type='text/javascript'> globalDivStruct=null; var _$variablesScopeVariable_func=function(){     var self=this;     var variables={};     self.__init=function(){         var localdivstruct=globalDivStruct;         var __output_var="";         var tmpVarArray={};         localdivstruct.outputvar+=message;        return""     } }; function __startPage__$variablesScopeVariable(){     document.write("\x3cdiv id\x3d'__cfclient_0'\x3e\x3c/div\x3e");     window.ispgbuild=false;     var clientDivStruct={         divId        : "__cfclient_0",         outputvar    :""     };     globalDivStruct=clientDivStruct;     try{         _$variablesScopeVariable=new _$variablesScopeVariable_func;         _$variablesScopeVariable.__init()     }     catch(__eArg){         if(__eArg!=="$$$cfclient_abort$$$")             throw __eArg;     }     __$cf.__flush(clientDivStruct) } __startPage__$variablesScopeVariable(); </script>
    The only significant difference (other than function names, based on the file names) between this and the URL-scoped example is the indicated line above is replaced by this in the URL example:
    localdivstruct.outputvar+=__$cf.__arrayGet(URL,"message",true);
    So it's like it's trying to do the right thing, but just failing. I thought it might be because CF does stupid thinks with scope-key casing, and changed the <cfclient> code to expect URL.MESSAGE not URL.message, but this didn't work either.
    So I'm flummoxed. I can't find anything in any documentation which might point me in the right direction, so anyone know what the story is here?
    Update:At Joel's suggestion I tried this:
    <script> message = "G'day World"; </script> <cfclient> <cfoutput>#message#</cfoutput> </cfclient>
    Thisworked. Which elicits from me a mixture of "heh: cute" and "this is an abomination". 
    Adam

    PaulNibin wrote:
    Hi Adam,
    When you write code inside <cfclient>, it is translated to java script. It cannot access server side variables(defined outside cfclient).
    <script> message = "G'day World"; </script> <cfclient> <cfoutput>#message#</cfoutput> </cfclient>
    The above code works because, message is defined in a script block and client side CFML is interoprable with javascript. So client side CFML can use variables, functions defined in javascript blocks.
    Thanks,
    Paul
    So you're saying you did not provide a mechanism for transferring the variables from the server-side part of a file's code to the client side part? Is this not a bit of an oversight?
    And what - in your mind - is the point of having a file with blocks of both normal CFML, and then a <cfclient> block, then more CFML, then another <cfclient> block (for example) if the code cannot interact?
    Adam

Maybe you are looking for

  • SOAP Error

    Hi, My sceanario is IDOC to SOAP In my SOAP receiver communication channel am getting the error as below. Please let me know what is the issues SOAP: call failed: java.io.IOException: invalid http response: null Message processing failed. Cause: com.

  • My iMessages are coming from my email, how do I get them to come from my phone

    My iMessages are coming from my email, how do I get them to come from my phone number again?

  • Console

    Hi I am having weblogic 6.1 sp4. We are seeing strange behavious or admin console. We startup the admin server and see server status both as running. After 2 days we i see the server status it shows admin as running and managed server as blank. I try

  • Why does the youtube app doesn't play in HD?

    Why does the youtube app doesn't play in HD? I couldn't find any option of changing the stream option also. Please help!

  • WebEngine.getEngine.Load error thrown for this one site?  Possibly cuz asp?

    so I was trying out a sample for a splash screen and it ended up having a WebView so I decided to play around with it. I decided to try and open up a site for a company I work with, and I get some weird error. The original site fxexperience works, go