Trouble with SDK function get_Location

Hello!
I'm using the itunes' SDK to develop an application using C++. Everything is fine, except the IITFileOrCDTrack object's get_Location() doesn't seem to work.
----snip----
iTunes *iITunes = 0;
iTTrack *iITrack = 0;
HRESULT hRes;
hRes = ::CoCreateInstance(CLSID_iTunesApp, NULL, CLSCTXLOCALSERVER, IID_IiTunes, (PVOID *)&iITunes);
if(hRes == S_OK && iITunes)
     iITunes->get_CurrentTrack(&iITrack);
     if(iITrack)
     BSTR bstrLocation = 0;
     IITFileOrCDTrack *iITFile = 0;
     iITFile = (IITFileOrCDTrack*)iITrack;     
     iITFile->get_Location((BSTR *)&bstrLocation);     
----snip----
I get an exception every time on the line that contains the call to get_Location().
Any help anyone here can provide would be much appreciated. If you have any sample code that at least proves this function does what is advertised in the API/SDK, I would be most appreciative.
Thanks in advance!

Unfortunately you can't just do this:
iITFile = (IITFileOrCDTrack*)iITrack;
That would be much too easy. You need to perform the cast through COM using the QueryInterface() method, like so:
IITFileOrCDTrack *pFileTrack = NULL;
iTrack->QueryInterface(IID_IITFileOrCDTrack, (void**)&pFileTrack);
if (pFileTrack != NULL)
     pFileTrack->get_Location(&bstrLocation);
     pFileTrack->Release();

Similar Messages

  • Having trouble with put_line function in block statement..

    Am a student, and the request does not appear to be in my book anywhere... Nothing on put_line, or block statements that I can see..
    Need to write a block which will bring back via put_line for department 110: the department_id (departments table), the department_name (departments table), and the city in which the department is located (which must be pulled from locations table... can be joined by department_id). I can write the select statement with join, just not sure how to turn it into a block with put_line function..
    any advice appreciated.. Thanks.

    Hi,
    You need to format your code, so that it's easy to see what statements are in each section (DECLARE, BEGIN, etc.).
    The compiler doesn't care about this, but it will help anyone who tries to read your code, including yourself.
    Type {code} before and after formatted sections when posting messages on this site.
    All statements, including each individual variable declaration) end with a semicolon.
    If a query will return no more than one row, you can capture the results using an INTO-clause, right after the SELECT-clause. For every column in the SELECT-clause, there will be one variable in the INTO-clause.
    Lists, including lists of table names in a query's FROM-clause, are delimited by commas.
    In a query's FROM-clause, the real name of the table comes first, optionally followed by the alias you're using in the query.
    I think this is what you're trying to do:
    SET   SERVEROUTPUT  ON  SIZE 50000
    Declare
        dep_id    NUMBER;
        Dep_string VarChar (100);
    Begin
        select  d.department_id, d.department_name -- , l.city
          into  dep_id,          dep_string
          from  departments  d
             ,  locations    l
          where d.location_id = l.location_id
            and d.location_id = 110;
        DBMS_OUTPUT.PUT_LINE (Dep_string);
    END;
    /No one should ever have this many errors at one time. Write code in much smaller increments, and test after each one. For example, you know you'll be using dbms_output.put_line, so start with something like:
    SET   SERVEROUTPUT  ON  SIZE 50000
    BEGIN
        dbms_output.put_line ('Hello, world!');
    END;You may have problems if you forget semicolons, or SET SERVEROUTPUT. Solve those before you go any further.
    Once the program above is working, add a little (and I mean a little) to it.
    For example, you know you'll be printing a varibale, not a literal, so change it to a variable:
    SET   SERVEROUTPUT  ON  SIZE 50000
    DECLARE
        dep_string  VARCHAR2 (100) := 'Hello, world!';
    BEGIN
        dbms_output.put_line (dep_string);
    END;And so on.
    Edited by: Frank Kulash on Dec 15, 2008 12:36 PM

  • Trouble with median function

    I need to use median function in fact table in my repository. In business model I have fact table with logical column(column where I used median function with name "MyCalculacion"). And I have Time dimension with column ("Year", "Quarter"(with value: 1,2,3,4) and "Month"(with value: 1,2,3,4...12))
    In Answers if I have this query with 3 column: "Year","Quarter", "MyCalculacion" I don't get good result set...
    This is SQL query from BI in this case
    select T6532.CAL_YEAR as c2,
    T6532.CAL_QTR as c3,
    T4899.OUTCOME_ID as c5
    from
    W_DAY_D T6532,
    (select ID,outcome_id,eventtime from event where dtype='Discharge' ) T4899
    where ( T4899.EVENTTIME = T6532.CALENDAR_DATE )
    order by c3
    But when I only change function from Median to StdDev(Standard Deviation) in column "MyCalculacion" I get good result. I have this SQL query:
    select T6532.CAL_YEAR as c1,
    T6532.CAL_QTR as c2,
    stddev_samp(T4899.OUTCOME_ID) as c3
    from
    W_DAY_D T6532,
    (select ID,outcome_id,eventtime from event where dtype='Discharge' ) T4899
    where ( T4899.EVENTTIME = T6532.CALENDAR_DATE )
    group by T6532.CAL_QTR, T6532.CAL_YEAR
    order by c1, c2
    I "bolded" important difference.In this case BI create query with function stddev_samp.
    After this i trued with some other function in my logical column. And good result are always when is function in SQL query. So OK is when I used StdDev,StdDevPop,avg,count,sum , but not OK with Median,First,Last...
    any help and/or clue?
    thanks in advance

    ... so Fringe is loaded for each Product Line but not for any particular project, therefore at a 'Project_na'??<BR>if so, you could <BR>1) Create a parent for 'Projects' - outline now<BR>Contract<BR> |--Project_na<BR> |--Projects (parent)<BR> |--Project1 (child)<BR> |--Project2....(child)<BR> <BR>Then, if I understand your requirements, I think your calc script could be.....<BR><BR>FIX(Scenario, period, fiscalYear,currency,Product_na)<BR> FIX(AIR)<BR> Fringe=@ALLOCATE(Project_na,@RELATIVE(Projects,0),directLabour,,SHARE);<BR> ENDFIX<BR> FIX(NAVY)<BR> Fringe=@ALLOCATE(Project_na,@RELATIVE(Projects,0),directLabour,,SHARE);<BR> ENDFIX<BR> FIX(LAND)<BR> Fringe=@ALLOCATE(Project_na,@RELATIVE(Projects,0),directLabour,,SHARE);<BR> ENDFIX<BR><BR>This would (for each product line) allocate Fringe-> Project_na to Fringe->@relative(projects) based upon Direct Labour costs. Assuming that Accounts are Dense, this shouldn't create block creation errors since DirectLabour already exists / therefore Block exists?<BR><BR>(Am I correct here?)

  • N73 - trouble with search function for the contact...

    Hi, i just bought a N73 series phone. i noticed that N73 search function for the contact list is different from others standard. Normally, it should show the 1st contact of the 1st letter that i pressed instead of the contact contains the letter. I found difficulties to look for the contact unless i press 3 or 4 letters. is there any setting can be changed to order search function only search the contacts with the 1st letter that i pressed instead of the letter in middle of the contact?
    For example:
    ang on
    office
    when i pressed "o", the contact will search for "ang on" instead of "office" unless i press few more letters like "off".
    hope to get some help from you guys.

    I found the same problem as this with all my S60 3rd edition phones, what I have done is in my contacts put a hyphen (-)in between the name - i.e Joe Blogs would come us under searches for J & B, so try putting Joe-Bloggs, this way, the search will only come up with all the J's in your phone book directory.
    Hope this helps, DLJ
    DLJ

  • Trouble with Preview function- thumbnails

    Adobe photoshop elements 9:  Problem occurs after downloading my images from my camera's memory card.  I have all the thumbnails open & have always right clicked on an individual photo, hit preview & viewed my photos as a slideshow to copy, delete, etc..  The preview function is not working, and had quit working just recently on my Elements 8 before I replaced it with the 9 version.  How can I fix this or is there another way to look at my photos full screen, one after another without individually opening each one, then having to go back & start over?

    Hi,
    If you are opening these files in Organizer, resetting organizer preferences should help. Go to %appdata%\Adobe\Elements Organizer\9.0\Organizer\ on Win or ~\library\Application Support\Adobe\Elements Organizer\9.0\Organizer\ and delete the following files :
    psa.prf
    status.dat
    If that doesn't help, I would suggest repairing and optimizing your catalog.
    Thanks
    andaleeb

  • Trouble with JSTL functions uri

    I have JSTL 1.1 installed, am using J2EE 1.3 on Websphere 5.0 and am referencing 2.3 DTD in my web.xml. I have the jstl.jar, standard.jar, jdbc2_0-stdext.jar, xalan.jar and xercesImpl.jar in WEB-INF/lib
    I can successfully use the core JSTL functions with
    <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> but have not been able to get the functions URI to work.
    I have tried the two listed below
    <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
    <%@ taglib uri="http://java.sun.com/jstl/functions" prefix="fn" %>
    but get the error:
    [Servlet Error]-[File "http://java.sun.com/jsp/jstl/functions" not found]: org.apache.jasper.JasperException: File "http://java.sun.com/jsp/jstl/functions" not found
    Can someone please tell me what I am doing wrong or if I am trying to use something that I shouldn't with my setup. I have only started using JSTL this week and have a lot left to learn.
    Thanks!

    I want to use JSTL 1.1 tags if possible. Not possible given your environment.
    Its on the header of the taglibs site:
    Standard-1.1 (JSTL 1.1) requires a JSP container that supports the Java Servlet 2.4 and JavaServer Pages 2.0 specifications. (http://jakarta.apache.org/taglibs/doc/standard-doc/intro.html)
    Websphere 5.0 supports only Servlet 2.3 and JSP 1.2. Thus you can only use JSTL1.0 with it. JSTL 1.0 does not define these functions.
    Sorry, but thats the way things are.
    Cheers,
    evnafets

  • Grapher having trouble with trig functions

    Well I thought that I could make some cool visuals for my math class by using grapher instead of just making charts and graphs in Excel on my pc, but no dice with that idea. I created all the different variables (and how they related to x, ie x^2*(5-x6)/x=m) and it was pretty cool how it would all come together and I could use those variables in other equations instead of writing it all out (stuff like y=4x^m-m/5). (Those are examples, not anything I used)
    Everything seemed fine until I tried to use a cosine function in one of the equations. It seemed really intuitive and recognized cos as cosine and not the variables c, o, and s multiplied, so I thought "great!" Then when I entered it the graph didn't appear anything like it should have. It gave me a Richter scale instead of a slightly curved line. I spent about half an hour trying to find my own error but then realized maybe there was something wrong with the program. I tried just plain old cos(x) and found that it was completely off. Instead of traveling from 0,1 to 180,-1 like it should have, it went from 0,1 to 3.1475,-1. This was way off so I tried a sine function and that did the same exact thing (having a period of roughly 6.295 instead of 360!). These functions were way off, and I'm using an intel macbook from my school (with 10.5), so I thought maybe someone changed the settings, so I tried them them on my aunts g4 macmini (10.4.11 I think) and it gave me the same problem!
    Anyway what's wrong with the trig functions for Grapher and how can I fix them?

    Emzz, I'm running 10.5.5 (Intel) and Grapher v2.0. My version of Grapher supports changing Trigonometric Mode, so the absence of this option seems to have nothing to do with Leopard.
    But let's do some Math now. As you surely know the cosine has (besides others) a root at 90 Degrees in the unit circle. Now let f : (angle in Degrees) -> (length of the corresponding arc of the unit circle) be a mapping. For 90 Degrees f yields 0.5*Pi. That means cosine has a root at 0.5*Pi in Radian unit.
    Now, if you swith Grapher's Trigonometric Mode from Degrees to Radian, cosine will no longer have a root at 90 but at approximately 1.57. Hope that explains a bit...
    By the way, Radian is the standard unit of angular measurement when it comes to trigonometric functions. For more details about Radian see [this article at Wikipedia|http://en.wikipedia.org/wiki/Radian] (click the link to be redirected).
    I suggest you close this topic because, as you already noted yourself, your initial question is answered.
    Good computing.
    floba
    (MN576)
    Message was edited by: floba

  • I am having trouble with a function in vb can anyone give me a suggestion?

    I am trying to calculate a cable bill of a residential customer and a business customer, when the customer checks the list box of the channels and the connections I need it to add it up. I have edited the code. Does my logic make sense?
    for residential customers it is 4.50 processing,30 basic service and 5 per channel
    so is the logic processing+basicservice *premium
    Public Class Main
    Private Sub btnCalculate_Click(sender As Object, e As EventArgs) Handles btnCalculate.Click
    If Data_Validated_ok() = False Then Exit Sub
    Dim premiumChannels As Integer = lstPremium.SelectedIndex
    Dim Connections As Integer = lstConnections.SelectedIndex
    Dim totalDue As Decimal
    If radResidential.Checked Then
    totalDue = CalcResidentialTotalDue(premiumChannels, Connections)
    lblTotal.Text = totalDue.ToString("C2")
    Else
    totalDue = CalcBusinesssTotalDue(premiumChannels, Connections)
    lblTotal.Text = totalDue.ToString("C2")
    End If
    End Sub
    ' make a function to calculate residential customers
    Private Function CalcResidentialTotalDue(ByVal premiumChannels As Decimal, ByVal connections As Decimal
    ) As Decimal
    Const ResidentialProcessing As Decimal = 4.5D
    Const ResidentialBasic As Integer = 30
    Const ResidentialPremium As Integer = 5
    Return ResidentialProcessing + ResidentialBasic + ResidentialPremium * premiumChannels
    End Function
    ' make a function to calculate business customers
    Private Function CalcBusinesssTotalDue(ByVal premiumChannels As Decimal, ByVal connections As Decimal
    ) As Decimal
    Const BusinessProcessing As Decimal = CDec(16.5)
    Const BusinessBasic As Integer = 80
    Const BusinessPremiumchannels As Integer = 50
    Return BusinessProcessing + BusinessBasic + BusinessPremiumchannels * premiumChannels
    End Function
    here is  a pic of my listboxes
    [IMG]http://i57.tinypic.com/muepug.png[/IMG]
    http://i57.tinypic.com/muepug.png

    The statement below is wrong in both functions.  You are passing the variable "connections" in the function parameter list and not using the variable.  I thing in the statement below you need to change connections to something else.
    connections = Convert.ToDecimal(lstConnections.SelectedItem)
    Here are the two parameter lists
    1)    Private
    Function calcResidentialTotal(ByVal connections
    As Decimal,
    ByVal premium As
    Decimal)
    As Decimal
    2)   Private
    Function calcBusinessTotal(ByVal connections
    As Decimal,
    ByVal premium As
    Decimal)
    As Decimal
    jdweng

  • MX430 and trouble with fax function.

    When sending transmission is canceled with message:  "RX fax info mismatch" ?

    Hi davenort,
    This error can occur when the transmission is canceled due to the machine not being able to detect the recipient's fax machine information, or the information did not match the dialed number. It's likely the Check RX fax setting is set to ON.
    When this setting is enabled, before sending a fax, the machine checks whether the recipient's fax machine information matches the dialed number.  Please try the following to change this:
    Press the FAX button, then press the Menu button.
    The Fax settings screen is displayed.
    Use the button to select Transmission settings, then press the OK button.
    Use the button to select Check RX fax info, then press the OK button.
    *Set this to Off if you wish to disable the checking.
    Hope this helps!
    Did this answer your question? Please click the Accept as Solution button so that others may find the answer as well.

  • Trouble with loadMasters function.

    Hey everybody,
    I'm trying to automate the replacement of a number of master spreads across many documents. Unfortunately, I keep getting the following error:
    Error Number: 48
    Error String: Cannot find the folder " ".
    Both of these code snippets give the same result:
    var oldDocument = File("/c/Users/me/Desktop/Template.indt")
    myDocument.loadMasters(oldDocument.fullName);
    myDocument.loadMasters(File("/c/Users/me/Desktop/Template.indt").fullName);
    If I have the document open from which I'm loading the masters, the following code works:
    myDocument.loadMasters(app.documents.item("Template.indt").fullName);
    The problem is, I don't want to have that file open while performing the script. Thanks in advance for your help!

    Hi Camb,
    Please try the below JS code. i have modified your code its working fine.
    app.scriptPreferences.userInteractionLevel=UserInteractionLevels.neverInteract;
    var oldDocument = File("~/Desktop/Template.indt")
    app.activeDocument.loadMasters(oldDocument, GlobalClashResolutionStrategyForMasterPage.LOAD_ALL_WITH_OVERWRITE);
    app.scriptPreferences.userInteractionLevel=UserInteractionLevels.INTERACT_WITH_ALL;
    thx
    csm_phil

  • Trouble with sleep function

    My macpro take about 15 seconds to go to sleep after I hit the sleep button under the apple logo in the upper left hand side of the screen.  I just purchased a brand new iMac and transferred all files to it and it is doing the same thing.  Is it possible that if something is wrong I just transferred it to my new iMac? Does anyone have a solution or possibly know what the probelm is?

    There is no other user account I have the only account.  I did the transfer using an external hard drive and the time machine backup.
    Hardware Information:
              MacBook Pro (15-inch, Late 2008)
              MacBook Pro - model: MacBookPro5,1
              1 2.66 GHz Intel Core 2 Duo CPU: 2 cores
              4 GB RAM
    Video Information:
              NVIDIA GeForce 9600M GT - VRAM: 512 MB
              NVIDIA GeForce 9400M - VRAM: 256 MB
    Startup Items:
              HP Trap Monitor - Path: /Library/StartupItems/HP Trap Monitor
              Qmaster - Path: /Library/StartupItems/Qmaster
    System Software:
              Mac OS X 10.7.5 (11G63) - Uptime: 0 days 0:45:2
    Disk Information:
              Hitachi HTS723232L9A360 disk0 : (320.07 GB)
                        disk0s1 (disk0s1) <not mounted>: 209.7 MB
                        Untitled (disk0s2) /: 319.21 GB (131.57 GB free)
                        Recovery HD (disk0s3) <not mounted>: 650 MB
              MATSHITADVD-R   UJ-868 
    USB Information:
              Apple Inc. Built-in iSight
              Apple Inc. BRCM2046 Hub
                        Apple Inc. Bluetooth USB Host Controller
              Apple, Inc. Apple Internal Keyboard / Trackpad
              Apple Computer, Inc. IR Receiver
    FireWire Information:
    Thunderbolt Information:
    Kernel Extensions:
    Problem System Launch Daemons:
              [not loaded] ftp-proxy.plist
    Problem System Launch Agents:
    Launch Daemons:
              [loaded] com.adobe.fpsaud.plist
              [loaded] com.adobe.versioncueCS4.plist
              [loaded] com.google.keystone.daemon.plist
              [loaded] com.microsoft.office.licensing.helper.plist
              [failed] com.vmware.launchd.vmware.plist
    Launch Agents:
              [loaded] com.adobe.CS4ServiceManager.plist
              [loaded] com.google.keystone.agent.plist
              [loaded] com.kodak.BonjourAgent.plist
    User Launch Agents:
              [loaded] com.adobe.ARM.202f4087f2bbde52e3ac2df389f53a4f123223c9cc56a8fd83a6f7ae.plist
              [loaded] com.adobe.ARM.925793fb327152fd34795896fa1fb9ffa268b2a852256fe56609efa3.plist
              [failed] com.ecamm.printopia.plist
              [loaded] com.kodak.KODAK AiO Firmware Updater.plist
              [loaded] com.kodak.KODAK AiO Software Updater.plist
    User Login Items:
              AdobeResourceSynchronizer
              Dropbox
              HP Scheduler
    3rd Party Preference Panes:
              Adobe Version Cue CS4
              Flash Player
              Flip4Mac WMV
              Perian
    Internet Plug-ins:
              AdobePDFViewer.plugin
              AdobePDFViewerNPAPI.plugin
              Flash Player.plugin
              FlashPlayer-10.6.plugin
              Flip4Mac WMV Plugin.plugin
              googletalkbrowserplugin.plugin
              iPhotoPhotocast.plugin
              JavaAppletPlugin.plugin
              npgtpo3dautoplugin.plugin
              o1dbrowserplugin.plugin
              QuickTime Plugin.plugin
              SharePointBrowserPlugin.plugin
              Silverlight.plugin
    User Internet Plug-ins:
    Bad Fonts:
              None
    Top Processes by CPU:
                   4%          WindowServer
                   3%          EtreCheck
                   3%          Finder
                   1%          hidd
                   1%          fontd
                   1%          SystemUIServer
                   0%          mds
                   0%          ps
                   0%          Dropbox
                   0%          configd
    Top Processes by Memory:
              86 MB              mds
              82 MB              Google Chrome
              61 MB              Finder
              57 MB              Dropbox
              49 MB              WindowServer
              49 MB              Google Chrome Helper
              33 MB              Dock
              25 MB              coreservicesd
              25 MB              EtreCheck
              20 MB              SystemUIServer
    Virtual Memory Statistics
              933 MB             Free RAM
              1.16 GB            Active RAM
              1.30 GB            Inactive RAM
              386 MB             Wired RAM
              878 MB             Page-ins
              0 B                Page-outs

  • Im having trouble with SDK Version 1.3 someone please help

    I downloaded it and installed it, when I go to javac or compile the thing it says "Bad Command or filename" However it will Java it but there's no use in that if I can't javac it. Anyone have a solution to this?

    Set your path by editing your autoexec.bat file (copy it b4 you change it for safety sake) on win98 or from control panel on NT.
    Have a look at
    http://java.sun.com/docs/books/tutorial/getStarted/cupojava/index.html
    Its a step by step lesson on getting things like path and classpath (you prob dont have to set classpath ) set for windows or linux or macs so you dont have to do something like the following each time you want to compile something
    or do this on windows 98
    C:\jdk1.3.0_1\bin\javac YourProgramName.java
    (you understand that C:\jdk1.3.0_1\bin\javac should be whatever the path is to javac on your machine)

  • Trouble with FormatPercent in SSRS

    Hi All,
    I am working on SSRS and I am having trouble with FormatPercent function.I have two columns which are units
     and another column representing corresponding values.Units column contains %, kg  and so on. the row 
    containing % as unit should have value
    in this format 'value%'
    For example
    1.%   4
    2.%   3
    3.kg  2
    This should look like
    1.%  4%
    2.%  3%
    3.kg  2
    I am writing this query "=IIF(Fields!units.value="%',FormatPercent((Fields!CURRENT_VALUE.Value/100),2),Fields!CURRENT_VALUE.Value)"
    in TextProperties->Set Number formatting options.
    when I execute this I am getting
    1.%  400%
    2.%  300%
    3.kg 2
    I would be thankful,if anyone can help me to solve this issue asap.
    Regards,
    Arjun

    Hi Arjun,
    Per my understanding that you are using the expression in the custom format of the "Text Box properties" right?
    I have tested on my local environment, if so, it will cause the result not correct, I recommended you to just use the expression in the field by right click the field and select the "Expression":
    Or you can modify the expression as below to use in the custom format:
    =IIF(Fields!units.value="%',FormatPercent((Fields!CURRENT_VALUE.Value/100),0),Fields!CURRENT_VALUE.Value)
    You can also use method below to achieve this:
    Add expression of the field:
    =IIF(Fields!units.value="%', Fields!CURRENT_VALUE.Value/100,Fields!CURRENT_VALUE.Value)
    Then add this expression in the custom format:
    =IIF(Fields!units.value="%',"P2",nothing)
    If you still have any problem, please feel free to ask.
    Regards
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • Strange syntax error message with some functions!

    Hello!
    I have a strange trouble with some functions in Numbers.
    For example when I try an IF function directly copied and pasted from Numbers documentation I get an error from Numbers that “the formula contains a syntax error.
    *The function looks like this:*
    *=IF(E6>=0, “Nonnegative”,”Negative”)*
    *The value in cell E6 is 25.*
    Anyone have a clue about why?

    Hello
    If you enter my iDisk
    <http://idisk.mac.com/koenigyvan-Public?view=web>
    You will be able to download:
    suriWork:for_Numbers:pour_modifierNumbers.zip
    Which gives the ability to change the Numbers behavior (same thing for Pages and Keynote).
    Applying it you will get an "Insert functions" tool matching your local settings.
    It will insert functions using the semi-colon as parameters delimiter.
    Yvan KOENIG (from FRANCE samedi 24 mai 2008 15:38:41)

  • Win SDK function conflict with CVI library function

    I do not have  SDK_CONFLICT_PRIORITY defined.  Is this new to CVI 2009?
    The following code gives me an error  "11, 58   Too many arguments to `CVI_WriteFile'."
    #include <windows.h> 
    #include <formatio.h>  
    void function (void) {
        HANDLE hHandle = INVALID_HANDLE_VALUE;
        char buffer [1000] = {'\0'};
        DWORD dwWriteCount;
      if (!WriteFile (hHandle, buffer, 5, &dwWriteCount, NULL)) {
    I have included  <windows.h>   before   <formatio.h>  but CVI still wants to use the formatio version of WriteFile - it appears to have been renamed   CVI_WriteFile  ?!?!?
    If I eliminate the #include <formatio.h>  it compiles OK.
    Message Edited by menchar on 03-06-2010 04:00 PM

    Well, the complete source for formatio.h I reported before is this one:
    #ifdef _NI_mswin32_
    extern int CVIFUNC      cviprefix(CloseFile)(int handle);
    extern int CVIFUNC      cviprefix(OpenFile)(const char *filename,int rd_wrt, int action, int bin_ascii);
    extern int CVIFUNC      cviprefix(ReadFile)(int handle, char *buf, int count);
    extern int CVIFUNC      cviprefix(WriteFile)(int handle, const char *buf, int count);
    extern int CVIFUNC      cviprefix(SetCommitMode)(int commit);
    #define CloseFile       cviprefix(CloseFile)
    #define OpenFile        cviprefix(OpenFile)
    #define ReadFile        cviprefix(ReadFile)
    #define WriteFile       cviprefix(WriteFile)
    #define SetCommitMode   cviprefix(SetCommitMode)
    #else
    In the header this warning is present:
    /* This header must be included after any Windows SDK header or any header */
    /* that directly or indirectly includes a Windows SDK header.              */
    /* Some of the function names conflict with Windows SDK functions.         */
    As far as I can understand (but I'm not an expert on these very technical and tricky aspects of C) first of all CVI functions are renamed CVI_xxx, after it a call to WriteFile or any other function in that group is defined to be translated to CVI_WriteFile, so when you call WriteFile the preprocessor actually translates it in the CVI version of the function and SDK one is superseded.
    My understandment is that if you undefine WriteFile, you can actually use both functions if you want: native CVI one by calling CVI_WriteFile and SDK one by simply calling WriteFile.
    ...or I can be missing some other hint, which can surely be possible!
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

Maybe you are looking for

  • Can no longer access Facebook via Safari on iPhone

    Ever since I loaded IOS 6 onto my iPhone 4, I cannot get to Facebook via Safari...it automatically reverts to the fb app. Even if I put www.facebook.com into the browser. I still access fb via Safari on my ipad (new ipad). This is important as I have

  • Why is the suite £800 more in the UK?

    I'd like to buy the master suite, but I noticed in the UK we have to pay £800 extra. I understand countries outside Europe have to pay extra taxes, but most of the time the extra cost is very tiny or absorbed by the company. Adobe is asking almost do

  • How can I ask Siri to turn on my Bluetooth device wireless speaker?

    I want to ask Siri to turn on my Bluetooth wireless speaker device.  But all she will do is turn on Bluetooth.  She won't ask for a device. 

  • Cant burn music files on CDs

    I am having trouble burning music cds using the burner. The music will initially burn but after listening to the disc I realize the quality becomes poor including lots of skipping, especially towards the end of the disc. I use a standard cd-r and nev

  • Need help with disabling the output excution command

    hey guys i'm doing an assignment in which user can input multiple lines. I'm using the scanner class. The problem i'm facing is that when user gives their input in multiple lines then it displays the asking input line even though it doesn't ask for n