Suppressing compiler-dependent warning when explicitly linking to DLLs?

Hi, I'm creating a DLL in CVI 2009 that I want to link explicitly in an application that is also build in CVI 2009 using LoadLibrary() and GetProcAddress().  This is working fine for linking of functions, but for global variables I get a warning when building the application:
"Warning: Conversion from 'FARPROC' to 'pointer to int' is compiler-dependent."
What I'm doing is, in the DLL, in the exports .h file I define:
extern int nnt_test;
And in the DLL's .c file I declare the global like:
int nnt_test = 465;
And in the application's .c file I access the variable like such (after loading the library):
int *g_test_varptr;
g_test_varptr = (int*)GetProcAddress(g_nnt_dllinst, "nnt_test");
This is the line where I get the compiler warning.  This method seems to work, as the application can see the value of the variable (465) and modify it and whatever it needs to do.  I'm not too terribly concerned if this doesn't work in other compilers as I don't plan on using an external compiler at this point.  Is there any way to suppress this warning so I don't have it popping up every time I build, or a better way of explictly linking global variables (other than creating Get/Set functions and linking those)?  Thanks!

To answer my own question, recasting as void* first seems to elimate the compiler warning, i.e.:
g_test_varptr = (int*)(void*)GetProcAddress(g_nnt_dllinst, "nnt_test");
I just need to sit and think about these things for longer before I post.

Similar Messages

  • Strange warning when compiling for iOS, "PIE disabled", Is it safe to submit to the App Store?

    I get this warning when building:
    ld: warning: PIE disabled. Absolute addressing (perhaps -mdynamic-no-pic) not allowed in code signed PIE, but used in _llvm_unwind from AOTBuildOutput-0.o. To fix this warning, don't compile with -mdynamic-no-pic or link with -Wl,-no_pie
    The app appears to be fine so far, and I haven't seen it mess up anything functionally yet, but am still testing.
    Edit: I am also curious as to what exactly this is. I think it is possibly related to an ANE that I NEED to use to work around a bug in AIR.

    I have never seen this warning cause any issues with the app so far.

  • -Xlint warning when compiling with command prompt.

    1 of the method i write in the program has a compilation warning when compiling with command prompt. When i compile the codes with the application i used to write the program has no error at all. Below is my code:
    private static ArrayList readNum(String NumFile)
    ArrayList key = new ArrayList();
    String keyAttributes = readInput(NumFile);
    StringTokenizer stk = new StringTokenizer(keyAttributes);
    while(stk.hasMoreTokens())
    key.add(stk.nextToken());
    return key;
    When i javac the program with -X;int, this errror occured:
    warning: [unchecked] unchecked call to add(E) as a member of the raw type java.util.ArrayList
    key.add(stk.nextToken());
    ^
    1 warning
    Anyidea how to solve this problem? Thanks for the help.

    A quick google for that message would have told you that you're not using generics and the compiler complains about that.
    Google for "Java Generics" to find out what all the fuss is about.

  • Why I always got a warning when compiling

    this is a small test on how to use Vector, i know it may not necessary
    my problem is the compiler always warns me that
    warning
    ==============================
    Note: F:\SmallTest_Car.java uses unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    (how to apply -Xlint, when use jcreator 3.5?)
    Process completed.
    ==============================
    can you help me find out the very reason?
    this is my program
    =================
    class Car
         double dHoursParked;
         double dCharges;
         public Car(double dFrist, double dSecond)
              dHoursParked=dFrist;
              dCharges=dSecond;
    }//end class car-----------------
    import java.util.*;
    class SmallTest_Car
         public static void main(String args[])
              Vector carRecords=new Vector(5);
              carRecords.add(new Car(1.0,2.0));
         }//end main
    }//end class question1after catch Exception, also got warning
    =============
    import java.util.*;
    class SmallTest_Car
         public static void main(String args[])
              Vector carRecords=new Vector(5);
              try
                   carRecords.add(new Car(1.0,2.0));
              catch(Exception e){     }
         }//end main
    }//end class question1

    - ignore the warning as it is not an error.worst suggestion.Except there are cases where valid working code produces warnings of this type which cannot be avoided. In some cases you have to just ignore the warning.

  • Maximum bit depth-maximum render quality when dynamic linking

    Hi
    A bit confused by the use of Maximum bit depth and Maximum render quality as used both in Sequence Settings and also as options when rendering in AME.
    1 Do you need to explicitly enable these switches in the sequence for best quality or, do you simply need to switch them on in AME when you render in Media Encoder?
    2 When dynamic linking to After Effects, when should you use an 8 bit vs 16 or 32 bit working space, and, how does this bit depth interact with the maximum bit depth, maximum render quality in PPro?

    Hi jbach2,
    I understand your confusion.  I'm like that most of the time I'm working. *chuckle*  The two settings you mentioned are two completely different parameters affecting (or is it effecting) your video. You do not need to enable them within the sequence itself unless you want to preview video on you program monitor at the highest quality.  I personally don't recommend it, as it's a tremendous resource hog, (the program even warns you when you try to click them) and unessecary for improving final output.  Again, do not enable these options in your sequence settings if you are only wanting a high quality export. Doing so will greatly reduce your editing performance unless you have a high-end system. ...and even then I don't think its worth it unless you're editing on a huge screen with a Director who wants to see everything at a maximum quality during the edit process.
    Keeping it simple...
    Resizing your final output video? Use Maximum bit depth.
    Starting or working with high bitdepth sources? Use Max Bit Depth.
    When/where do I enable these? In the AME only. ^_^
    Why?:
    Enabling the Max bit and Max render only needs to be done when you are exporting.  They both serve different functions. 
    Max Render aids in the scaling/conversion process only.  My understanding is that you never need to enable the Max Render Quality (MRQ) unless you are exporting in a format/pixel ratio different from your original video.  For example, when rendering a 1080p timeline out to a 480p file format, you'll want to use MRQ to ensure the best scaling with the least amount of artifacts and aliasing.  If you're exporting at the same size you're working with, DON'T enable MRQ.  It will just cost you time and CPU. Its only function is to do a high quality resizing of your work.
    Maximum bit depth increases the color depth that your video is working with and rendering to.  If you're working with video that has low color depth, then I don't believe it will matter.  However, if you're working with 32 bit color on your timeline in PPro and/or After Effects, using lots of graphics, high contrast values, or color gradients, you may want to enable this option. It ultimately depends on the color depth of your source material.
    The same applies to After Effects.
    Create something in AE like a nice color gradient.  Now switch the same project between 8,16,32 bit depth, and you will see a noticable difference in how the bit depth effects your colors and the smoothness of the gradient.
    Bit depth effects how different plugins/effects change your overall image.  Higher depth means more colors to work with (and incidentally, more cpu you need)
    Just remember that "DEPTH" determines how many colors you can "fill your bucket with" and "QUALITY" is just that, the quality of your "resize".
    http://blogs.adobe.com/VideoRoad/2010/06/understanding_color_processing.html
    Check out this adobe blog for more info on color depth ^_^  Hope that helps!
    ----a lil excerpt from the blog i linked to above---
    Now, 8-bit, 10-bit, and 12-bit color are the industry standards for recording color in a device. The vast majority of cameras use 8-bits for color. If your camera doesn’t mention the color bit depth, it’s using 8-bits per channel. Higher-end cameras use 10-bit, and they make a big deal about using “10-bit precision” in their literature. Only a select few cameras use 12-bits, like the digital cinema camera, the RED ONE.
    Software like After Effects and Premiere Pro processes color images using color precision of 8-bits, 16-bits, and a special color bit depth called 32-bit floating point. You’ve probably seen these color modes in After Effects, and you’ve seen the new “32″ icons on some of the effects in Premiere Pro CS5.
    jbach2 wrote:
    Hi
    A bit confused by the use of Maximum bit depth and Maximum render quality as used both in Sequence Settings and also as options when rendering in AME.
    1 Do you need to explicitly enable these switches in the sequence for best quality or, do you simply need to switch them on in AME when you render in Media Encoder?
    2 When dynamic linking to After Effects, when should you use an 8 bit vs 16 or 32 bit working space, and, how does this bit depth interact with the maximum bit depth, maximum render quality in PPro?
    Message was edited by: SnJK

  • Warning when calling function using page text

    Hi *,
    I have a function in package which generates some parameters for a link I want to put on bottom of the View Form.
    The HTML I put in the bottom of View Form user text field looks like this:
    Create default visit for this group
    The problem is that Desinger throws a warning when I try to generate and the auto-install option gets ignored due to this error...
    Can I set Designer to ignore this "parse error", so that the auto-install works again?
    Here is the exact error message:
    Message
    CDG-03707: Module Component GROUPS.GROUPS: Invalid syntax in User Help Text or Page Text for Bottom of View Form: 'guides_package.visit_create...'
    Thanks in advance,
    Goeran Zaengerlein

    Is there actually a procedure 'get' inside a package 'pk_test'?
    Justin

  • Firefox 21.0 doesn't warn when closing multiple tabs

    I have a Mac OS X, version 10.6.8. I'm using Firefox 21.0. I have the box checked to warn me when closing multiple tabs. It does not. Why? Is there anything I can do to make it work correctly? Any information I've been able to find on the internet is for other versions of Firefox and is of no help to me.

    PROBLEM: Windows FF 21.0 warns when closing multiple tabs when ONE occurance of FF is open, but NOT when mutlipe windows are open (then it only warns once I'm down to 1 window open).
    I would like a warning for ALL windows' multiple tabs. I know this is possible because that has always been the case until approx. the latest update.
    Oddly enough, the only thing close I found is a post from 2011 with the exact opposite problem: warning only when multiple windows are open, but not when 1 window is open.)
    SUMMARY attempts gleaned and compiled from the various posts (with no effect):
    - at General tab, "Show my home page" is selected ("Show my windows and tabs from last time" is NOT selected)
    -at Tabs tab, "Warn me when closing multiple tabs" is selected
    - at Privacy tab, "Use custom settings for history" is selected along with "Always use private browsing mode" (is selected); however, this has always been my setting, and I've always received warnings in multiple windows until recently
    - staring in Safe mode had no effect
    - my about:config boolean settings are appropriately set to true/false
    - I've tried restarting Firefox multiple times and restarting the computer; I have not re-installed FF nor restarted from fresh, wiping out all settings because I have so many customizations.
    Any other thoughts of what I might try?

  • Firefox 8 and the "Warn when closing...multiple tabs" preference check box still doesn't work?

    I'm aware that I can go into the about:config screen and toggle a couple of settings but the real question is "Why is this still a problem since version 4?" Why bother to have Preferences at all, if the given solution is always to tweak the config?

    This hint was posted on a similar link that works for me. Here is what to do:
    In option -> privacy -> choose "use custom history setting" and choose your preference for history and cookie setting. and then click "OK'.
    Then you will get the warning when closing multiple tabs.
    It doesn't seem to be related but it does affect the operation of the other part of the software that issues the warning.

  • Compilation error warning

    Could someone please let me know that if it is a problem for querying database when there is compilation error warning?
    I've often received warning errors after creating a type, such as :" Type created with compilation error".
    Thanking in advance for your response.

    994819 wrote:
    I tried to get the following stored procedure to work... I've tried two different versions of the procedure... I have both versions below. I get a warning that the procedure was created but with compilation errors... this happens in Oracle 11g Express Edition... it references a function that I already created and has been tested.
    Version 1:
    create or replace procedure ins_ints(v1 number)
    as begin
    for i in 1..v1 loop
    insert into integers values(i,odd_even(i));
    end loop;
    end ins_ints;
    Version 2:
    create or replace procedure ins_ints(v1 in number)
    as begin
    for i in 1..v1 loop
    insert into integers values(i,odd_even(i));
    end loop;
    end ins_ints;
    Any idea whats wrong?
    Note: The odd_even function has the following function call:
    odd_even(v1 number) return varchar2
    again, just calling the funciton from the command line (SQL *Plus) works.
    Thanks!SHOW ERROR
    will display what the compiler does not like about your code
    How do I ask a question on the forums?
    SQL and PL/SQL FAQ

  • Flash Pro CS5.5 gives the right warning when JVM virtual memory is out. Thumbs up!

    In version 5.5, Flash PRO gives an exhaustive warning when JVM runs out of memory and cannot compile large projects.
    The popup gives you the correct informations, and also opens for you the jvm.ini file in flash ide to increase memory.
    Thumbs up Adobe!
    That is awesome!

    Hi all,
    I've got the combination of solutions working from what i've read on the forums and this is my solution which worked atleast for Adobe Premiere Pro CS 5.5 Family:
    Solution Adobe Premiere Pro CS 5.5 Family:
    Browse to \Installation\Adobe CS5.5\payloads
    1: Start with backing up your files which gave an error in the log: In my case, it first gave an error on the "Microsoft_VC80_CRT_X86" later when I fixed this .MSI package it also gave an error on the "Microsoft_VC90_CRT_X86" file. So I made a backup of the 2 folders which are indicated "RED" in the picture below.
    2: Copy from the green directory, the files which are in the image below
    3. Paste the 2 files into the X86 folder as in the image below, delete the 2 files which are indicated red by the image below, and then adjust the new files to the same name as the files which were deleted:
    4: You will probably have to do this twice for the different errors.
    Extra step 5: I'm mentioning this step because im not sure if this helped, but I also uninstalled the MSI files to be sure there was nothing left behind of the old installer.
    Hope this helps, I will try the same for After Effects and let you know if this also works.

  • Warning when opening a .doc file (with Pages) ruins my applescript convert process

    I have 2000 plus documents (some Pages, most .doc) that I need to convert to PDF. I've got a working applescript droplet that converts both doc and pages files very nicely... but on some of the .doc files I get this dialog: "Some warnings occured. Would you like to review them now."  This of course, ruins my script run.
    Is there a way to suppress this warning when Pages opens a .doc file?

    Only if there is a script for dialog boxes in your AppleScript which you would have to tailor for the responses.
    You can record snippets of mouse activity using the Script Editor and include those in your script if there are no AppleScript library items.
    Peter

  • Warning when migrating app to Flex 4

    I'm getting this warning when migrating an app to Flex 4:
    AboutModule is a module or application that is directly referenced. This will cause modules:AboutModule and all of its dependencies to be linked in with MyKoolApp. Using an interface is the recommended practice to avoid this.
    What should I change so I do not get this warning?

    Don't actually type the word AboutModule in the main app.  Doing so will
    likely link in that class and defeat the whole purpose of modules.

  • How to suppress compiler errors without excluding database objects from the "Schema Compare" tool (using VS2013/SSDT)

    Hi,
    In short: How to suppress compiler errors without excluding the object from the "Schema Compare" tool ??
    A bit longer:
    We have a SQL Server 2008 project in Visual Studio 2013 running SQL Server Data Tool.
    An old database, with a lot of history in, has been imported into SSDT and there are many syntax errors preventing the project from compiling/running. An typical error is: "SQL70001: This statement is not recognized in this context".
    Running the "faulty" scripts on the server, executes just fine. I understand that there are syntax errors and they should be rewritten, but it's not gonna happen just like that - it is a slow process over a long period of time.
    I know it is possible to change Build Action to None, but that also exclude the object from appearing in the Schema Compare function/window.
    So - how to ignore some compiler errors and still having the objects to appear when doing "Schema Compare" ??
    Thank you in advance.

    Hi Steven,
    Thanks for your comments.
    Well, it sure does help in the future, but right now i would prefer the other way - to suppress some errors and still allow the scripts to build.
    The thing is that if we "rewrite" the objects into create scripts, then we have a huge test job ahead of us + the database environments (PROD vs DEV and UAT) does not share the same AD or DB users and therefore grants is lost if dropping/creating
    objects, right!
    If you drop a object before creating it, the drop will also drop the roles and grants and since they don't share user table, the create will not be able to add the permissions again. There might be a solution to that, but it is going to be very complicated
    for some newbies like us. We need something we can trust.
    BR
    Peter

  • Safari Anti-Phishing- How does it work "Warn When visiting.." option

    So, when you turn that feature on: Warn When Visiting A Fraudulent Website," exactly how does Safari know that? I know it was introduced way back in version 3.2, but does it use Goggles safe browsing website info still? I can't seem to find any documentation on it for Safari 5 in how it works.
    Also, if it does use Googles Safe-Browsing database, what happens when you turn that feature off and THEN turn it back on? Does it start from sratch or continue building the database where it left off?
    Message was edited by: powerbook1701

    The blacklists from Google’s Safe Browsing Initiative (where Safari checks for 'fraudulent websites') are contained in a database cache file called SafeBrowsing.db - the file was created when you first launched Safari, and if you have the browser open, the file is modified approximately every 30 minutes.
    In other words it is part of Safari's (version 3.2 onwards) anti-phishing security feature.
    As an alternative to turning off 'Warn when visiting a fraudulent website', which will lose you that important security feature, you could delete that database file, (but first close Safari:
    In Tiger:
    Home/Library/Caches/com.apple.Safari (this is a folder)/SafeBrowsing.db
    In Leopard*:
    Private/Var/Folders/AF/AFONO9KnGpijQuAcxb6vf++TI/Caches/com.apple.safari/Safari/SafeBrowsing.db
    In Snow Leopard*:
    Private/Var/folders/iI/iIaUOKJyFS0xmSIANVYiD++TI/-Caches-/com.apple.Safari/SafeBrowsing.db
    (*This location may vary depending on your OS. Also, the name of that weird sounding folder will be unique to each user.)
    You can get to the Private/Var folder by using Go To in the Finder menu.
    It will be recreated next time you open Safari, and will then start again collecting details of dodgy websites.
    If you are interested:
    How the Anti-Phishing feature of Safari 3.2 onwards works:
    http://www.macworld.com/article/137094/2008/11/safarisafebrowsing.html

  • When a link is a Document, Firefox doesn't show my word processor in the application choices. When I browse for Word, it won't let me check the box to always us Word.

    When a link is a file (not a web site) Firefox opens a dialog box that begins "You have chosen to open...: and defaults to Save File. When I click on the Open File.. radio button, my word processing program, Word does not appear. When I Browse for the application in the Program Files folder of my computer, I can select Word but the check box to "Do this automatically for this file type from now on." is 'grayed out'. When I click OK, Word loads with the downloaded document.
    This is a real pain the in tokus to do this EVERY time. I have checked the association in Windows XP and that file extension IS associated with the Word application. What gives?

    Try using a different graphics type for your logo. Some don't translate well to Word. I used to know which ones were compatible but that was long ago and the list may have changed.
    Jerry

Maybe you are looking for

  • Whenever i go to open a picture message in full view the black loading screen just comes up with no picture? (verizon iphone 5)

    I have a 32gig iphone 5 on verizon and whenever i go to open a picture message the black screen that says loading just comes up and i can't view the picture... any help? PLEASE!

  • CTS Mgmt in SolMan for an Implementation Project?

    Hi, In an Implementation Project, if we need to use Solution Manager for CTS, is there any pre-requisites? To be more clear, the project is still in the development stage and has not gone-live. The SolMan project type will be "Implementation" project

  • Xslt in client memory

    Hello. I have some server components sending xml to a web browser client. There is a reference to an xslt stylesheet in the xml document, that results in html. I assume that every time the processor in the browser encounters that reference while pars

  • Iphone 5 MICROSOFT MESSAGE TO VERIFY MY ACCOUNT

    MICROSOFT HAS BLOCKED MY EMAIL INBOX REQUESTING VERIFICATION OF MY EMAIL ACCOUNT.WHEN I SEND AN ALTERNATIVE EMAIL THEY NEVER SEND ME A CODE TO UNBLOCK MY HOTMAIL INBOX ON MY IPHONE - HOW CAN I STOP MICROSOFT ASKING ME TO VERIFY MY EMAIL ACCOUNT.I HAV

  • CS4 action panel really really slow!

    Sorry if this issue was already posted, the search function on this forum was not working at the time of writing this. I just upgraded from Flash 8 to CS4, and the first thing I noticed was how slow the action panel was compared to Flash 8. When typi