Cannot open binary file in Momentics IDE using C++

Hello

This has more to do with C++ with qml but I'm stuck for awhile now and maybe someone here knows the answer.

What I want to do in my app is I open and read a file once I clicked on a button. This is my code to open the file:

// after button is clickedfstream file;
file.open("S:/filepath/file.abc", std::ios::in|std::ios::binary);

if(!file.fail()) qDebug() << "File not found!";
else if(!file.good()) qDebug() << "Can't open file";
else if(!file.is_open()) qDebug() << "Error opening file!";
else{
    qDebug() << "Start opening file ...";
    if(file.is_open()) {
        qDebug() << "File is open!";
    }
}

First of all I don't get the "file not found" - message so the! file.fail () command works very well and that the file exists.

But when I then check if the file is opened with! file.good () it gives me my error message that the file is not opened.

My version of test in Visual studio, has worked well. But not in the momentics IDE it does not work. Can someone give me a clue what to do?

I'll hazard a guess may be for the user to select a file and then read it in this case, you will need to use a FilePicker...

http://developer.BlackBerry.com/native/documentation/Cascades/UI/pickers/filepicker.html

Using what happens then a path valid + file name with which you can use to switch to QFile...

http://developer.BlackBerry.com/native/reference/Cascades/QFile.html

As a hint of Windows has its own way of doing things, UNIX (and in this case QNX with Qt/Cascades on top) another.

Tags: BlackBerry Developers

Similar Questions

  • Cannot open any file, start the system restore or use my original XP pro CD

    original title: no CAN NOT OPEN ALL the FILES ON MY OS, I can't START the SYSTEM RESTORE, I can't EVEN USE MY XP PROFESSIONAL ORIGINAL CD... HELP PLEASE!

    I HAVE A DELL INSPIRON / B130 LAPTOP WITH XP PROFESSIONAL OPERATING SYSTEM.  I GOT HOME THE OTHER DAY TO FIND MY ROOMMATE ON MY LAPTOP, AFTER THE LECTURES OF THE PERSON TO KEEP YOUR HANDS OFF. I OPENS AND DISCOVERS WHAT HAS HAPPENED. THE PERSON DOWNLOAD FREE DOWNLOADERS VIDEO 4 X, AS WELL AS FILMS AND OTHER JUNK ON MY COMPUTER... ETC I WENT TOO ADD REMOVE PROGRAMS AND DELETED PROGRAMS THAT KEPT DUPLICATE ITSELF. I SHUT DOWN MY COMPUTER, TO THE REBOOT. NOW I GET THESE MESSAGES... "WINDOWS CANNOT OPEN THIS FILE", EXE, FILES,. INK AND WELL BASICALLY ALL THE FILES FILES. I CAN'T OPEN THE SYSTEM RESTORE, ENTER ADMINISTRATOR, I CAN'T EVEN USE MY WINDOWS XP PROFESSIONAL CD ORINGINAL, IT SAYS: ERROR. 3514 LINE, I DON'T KNOW WHAT ELSE TOO CAN YOU PLEASE HELP ME? Thank you

    Hi Colleen,

    Please take a look at the following suggestions for a possible solution:

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_vista-windows_programs/cannot-open-any-exe-files-cant-open-any-programs/85545ac1-3822-47AA-b664-e4209c62e9be

  • Bad installation file for Momentics IDE 2.1.1

    Hello

    I just downloaded Momentics IDE for Linux 32 b 2.1.1 and I got this message after you run the binary file:

    cz7asm@cz7asm-Z97-D3h $./momentics-2.1.1-201411071638.linux.x86.run ~/Downloads
    Please enter accept, n otherwise: y
    Create the directory bbndk
    Check the integrity of archive... Error in MD5 checksums: b6b5bd01544bdc98dd85bed1156758d3 is different from 592d0acf58e00adc38048da163a1d9a3

    Now, it's very strange because I have donwloaded the file twice and the checksum remains the same. I suspect that there is a bug in the installation process. Also list of MD5 checksum on the website (http://downloads.blackberry.com/upr/developers/downloads/momentics-2.1.1-201411071638.cksum) does not show the MD5 sums:

    361730190 417369444./momentics-2.1.1-201411071638.linux.x86.run
    3117348421 401787406./momentics-2.1.1-201411071638.linux.x86_64.run
    1678733117 400627721./momentics-2.1.1-201411071638.macosx.x86_64.dmg
    4011323815 402781301./momentics-2.1.1-201411071638.win32.x86.setup.exe
    3082028438 387674552./momentics-2.1.1-201411071638.win32.x86_64.setup.exe

    Of course, there is only the sizes of different generations.

    Could someone give me some comments on this? I couldn't find any contact for people behind releasing Momentics IDE using this forum was the only option I could think.

    Thanks for any help.

    Petr

    The question of the checksum must also be fixed right now as well.  Give him another try and let me know if you still have problems.

  • line 58:. / runInstaller: cannot execute binary file

    I have problem in January while trying to install 9i on linux


    while I try to run. / runinstaller he gave me:

    . / runInstaller: line 58:. / runInstaller: cannot execute binary file

    I searched this error and output like the following:

    file/sbin/init
    / sbin/init: executable ELF 32-bit LSB, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5 linked dynamically (uses shared libs), stripped

    file runInstaller
    runInstaller: text of the Bourne shell script executable

    I thought that I could hurt donwload (64 byte) configurations and I will:

    http://www.Oracle.com/technology/software/products/Oracle9i/htdocs/390soft.html and download:


    Download the complete files (31 bits)
    lnx390_db_9201_Disk1.cpio.gz (440,724,391 bytes)
    lnx390_db_9201_Disk2.cpio.gz (616,447,271 bytes)


    i error again... someone has some idea?

    Thank you

    IBM MainFrame is a large central computer that can run it's own operating system called o/s 390 - Z/OS.

    It can run several Linux distributions in vm and it very fast!.

  • "Extraction failure: cannot open output file" error message when installing new drivers

    Hello, I am trying to install new drivers for my HP Photosmart C4385 printer.  I downloaded the complete drivers of features for Windows XP 32-bit, and when I start to install (extract), I get the error message:

    Extraction failed

    Cannot open output file

    And the process ends.  He arrived at about 85% extraction every time.

    No idea why?  I called HP, but no longer under warranty they wanted money, which I think as absolutely ridiculous - not even give me basic support?  Poor, poor customer service.

    Hi GIJeff12,

    Temporarily disable any AntiVirus/Antispyware software.

    Cut the installer on your desktop then click on the Start Menu, click computer, double-click on the C: drive and paste the installler here.  Now try a right click on the installer for your printer, choose 7-Zip and choose Extract the files, and then click Ok.  If the installation program extracts now correctly, follow these steps.  If it does not extract, let me know.

    Disconnect your printer from the PC.  Restart your PC.

    Open the newly extracted folder and double-click the setup application to start the installation (the installation application will probably have the same icon as the original installation software that you downloaded).  Connect the printer to your computer when you are asked.

    If it was a success, re - enable your security software.

    Best wishes

    DP - K

  • When I start my computer I get this error message: Windows cannot open this file: GLBD4EA.tmp

    When I start my computer, I get this error message:

    Windows cannot open this file: GLBD4EA.tmp

    To open this file, Windows needs to know what program you want to use to open it. Windows can go online to look for automatically, or you can manually select from a list of programs installed on your computer.

    What do you do?

    -Use the web service to find the appropriate program
    -Select a program from a list of installed programs

    No selection works for me. I don't know what concerns the .tmp file, or why I need to open it.

    Please help :)

    Hello

     
    Perform the following steps to remove the file from the registry.
    a: type regedit into the search box start and click on enter.
    b: Search now to the following key
    HLKM\SOFTWARE\Microsoft\windows\currentversion\run
     
    then delete the following key
    53E412B3-9907-4F9E-A6DC-D0106D1D72C
     
    Important:  This section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information
    However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click on the number below to view the article in the Microsoft Knowledge Base:
     
    Hope this information helps.
  • Cannot open pdf file not able to download adobe, disables security and still unable to download adobe

    Cannot open pdf files not able to download adobe. I disabled the security and still unable to download adobe

    Hi MarciaRicci,

    1. what operating system is installed on the computer?
    2. What is the exact error message you get when you try to download?
    3. what web browser do you use to download adobe?
    4. what happens when you try to open pdf files?
    5. you are trying to open online pdf files or pdf files on the computer?

    I suggest you try the steps from the following link:

    The problems of download
    http://kb2.Adobe.com/CPS/152/tn_15296.html

    Installation problems | Flash Player | Windows
    http://kb2.Adobe.com/CPS/191/tn_19166.html

    Choppy us back with more information.

  • Cannot open .exe files.

    I can't open files type .exe on my system. When I try to open it, Windows Meadia player open type .exe file and an error message that Windows Media player cannot open this file. This problem is about of any programs like Internet explorer, Microsoft Security Essentials etc. What should do? Please help me. Answer me to * address email is removed from the privacy *.

    Hello

    1. what operating system do you use?

    2 did you change on your computer?

    I suggest you follow the link and check.

    If you use windows XP, see the link.

    http://support.Microsoft.com/kb/555067

    If you use windows 7 see the link and check.

    When you run an .exe on a Windows Vista-based or Windows 7 computer file, the file may start another program

    http://support.Microsoft.com/kb/950505

  • Disk defrag cannot open a file(system32\dfrg.msc) to run

    This message appears when I click to open the defragmentation program:

    MMC cannot open the file c:\WINDOWS\system32\dfrg.msc.
    This file does not exist, is not an MMC console, or was created by a later version of MMC.

    Then what should I do? I looked around and I still have the file on the computer but I can't open it to all.  My computer needs to defragment very badly.  It there a way to get a new file or program? Or can I replace this question?

    Help

    Hi Highhopespf,

    Thank you for using Microsoft Answers!
    I have seen that the installation of Service Pack 3 can sometimes fix this.

    The following link should help you get installed: http://support.microsoft.com/kb/322389
    Let me know if that helps!

    Cody C
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Error message - Windows cannot open this file after downloading program

    After several days in offline mode, I went online to update Microsoft Security Essentials and click on analysis complete.  It took an hour.  After that, I found that all my programs were virgins, almost of all of the standard microsoft Microsoft Security Essentials is.  I tried to download it again, plus others such as adobe acrobat, but all said "windows cannot open this file".  I asked help from Microsoft but received access denied.  I feel like an illegal immigrant, as all the doors were closed.  What does that mean?  My OS would be illegal?  It is Windows XP and was purchased new in the retail price in 2004 and has only once been out of my hands when I sent it repairs and have 2 GB ram added.  Any ideas?

    Hello

    1. What is the full and exact error message?

    Try the steps from the following link and check if it helps:

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_xp-performance/when-trying-to-open-desktop-icons-get-message/e75fd1c3-F772-E011-8dfc-68b599b31bf5

    I hope this helps.

  • Error - Windows cannot open this file when trying to install Microsoft Gadgets.

    Original title: how to install gadget from Microsoft.

    I down loaded the gadgets and themes, when I go to install, Windows cannot open this file. If I get them from microsoft, it seems that windows can open.

    Hi mikemontgomery,

    If you use windows XP, it is not possible to install Microsoft Gadgets on it. Microsoft Gadgets are optimized for Windows Vista and Windows 7 only.

    However, you can use your favorite search engine to download third-party gadgets which can serve the purpose.

    Note: Using third-party software, including hardware drivers can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the use of third-party software can be solved. Software using third party is at your own risk.

    Reference: Desktop and SideShow gadgets

    Hope the helps of information.

    Please post back and we do know.

  • I want to play Freecell and solitaire that came with my PC, but I get this error: "Windows cannot open this file: free cell.exe.mui.»

    Can help please I want to play freecell and solitaire that came with my pc but I get this error message... Why would he do that? How can I solve this problem?

    original title: windows cannot open this file: free cell.exe.mui.

    Hello

    1. don't you make changes to the computer?

    These can help you:

    Method 1: Perform a system restore

    To get the procedure perform system restore, open the site mentioned below

    http://Windows.Microsoft.com/en-us/Windows-Vista/what-is-system-restore

    Method 2: Clean boot

    For the procedure to place the computer in a clean boot, open the site mentioned below

    http://support.microsoft.com/kb/929135.

    Note: To set the computer back to start normally, use the step 7 in the same link.

    Method 3: Check the new user account

    Open the site mentioned below for steps to create a new user account

    http://windows.microsoft.com/en-US/windows-vista/Create-a-user-account.

    I hope this helps.

  • WINDOWS cannot OPEN THE FILE D:\Sources\Install.wim REQUIERED. Make sure that all required files for installation aare available and restart the installation. Error code: 0x8007000D,.

    IM TRYING to re - INSTALL WINDOWS VISTA ON MY T-6321 to the front door, BUT WHEN I INSERT THE DISC, AND INSTALL, a MESSAGE APPEARS SAYING: WINDOWS cannot OPEN THE FILE D:\Sources\Install.wim REQUIERED. Make sure that all required files for installation aare available and restart the installation. Error code: 0x8007000D, SHOULD ALL BE ON THE DISCALREADY?

    Hi JRCLNSIN100,

     

    Welcome to Microsoft Answers Forums.

    We would like to get some more information from you to help solve your problem. You better, please answer the following questions.

    ·         What is the disk you use to reinstall?

    ·         Is this a recovery or reinstalling the disc you are using?

    ·         When exactly do you get this error message?

    ·         What is the edition of Windows Vista, you try to install?

    ·         How old is the drive that you are using?

    ·         How are you starting the installation process?

    After researching the error 0x8007000D code is essentially due to file corruption and a problem with the drive itself.

    First check if you have scratches or dust on the disc and clean the surface and try again.

    To check if the disk is wrong, you will need to copy the contents of the DVD to the hard drive and try to install using that.

    To perform a flat installation of Windows Vista, follow these steps.

    Note The hard disk must have at least 3 GB of free space on the disk for the Windows Vista installation files. The hard disk must have at least 15 GB of additional disk space to install Windows Vista. For more information about system requirements for Windows Vista, see the Microsoft Web site at the following address:

    http://www.Microsoft.com/Windows/products/windowsvista/editions/SystemRequirements.mspx

    1. Insert the Windows Vista installation disc.
    2. Start Windows Explorer.
    3. In Windows Explorer, click to select the drive for the Windows Vista installation disc.
    4. On the Edit menu, click select all.
    5. On the Edit menu, click copy.
    6. Click to select the hard disk you want to contain the flat installation files.
    7. On the file menu, point to new, click the folder, type Windows Vista Setupand then press ENTER.
    8. Double-click the Windows Vista Setup program, and then click Paste on the Edit menu.
    9. Double-click Setup.exe, and then follow the instructions that appear.

    See the link below for more information on flat installation.

    How to perform a flat installation of Windows Vista

    http://support.Microsoft.com/kb/928902

    This problem can also occur if the firmware of the DVD drive is defective or obsolete.

    If the step above does not resolve the question suggests that you install the latest drivers for the DVD player on the computer.

    For more information please visit the link below.

    Error message when you try to install Windows Vista by using the DVD drive on the computer: "Windows cannot install required files".

    http://support.Microsoft.com/kb/930984

    Hope this information is useful.

    Let me know if it worked.

    All the best!

    Thanks and greetings

    Halima S - Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Error message: Windows cannot open this file

    Whenever I click one of my contacts in my contacts folder, I get a message that says Windows cannot open this file and gives me the choice to open with another program or search the Internet for a program to open my file of contacts.  Can someone help me with this please?

    Right-click on any contact, and then click Open with...  Then select Windows Contacts (it may have been changed to another program) and check the box at the bottom that says always use this program to open this type of file, and then click OK.  If the Windows Contacts is not listed, click Browse and find the main executable file for Windows Contacts add the program then select it and check the button.  To help you find this file, go to the Windows Contacts shortcut in the menu start / all programs and right click on it and find out the location of the target - is where you ought to watch.

    I hope this helps.

    Good luck!

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • Windows cannot open this file .json

    In joomla 2.5.6, when you try to download an image from the file button I get this error message in Internet Explorer 9 - Windows 7 Professional
    : Windows cannot open this file:

    file: .json joomla (3)
    To open this file, Windows needs to know what program you want to use to open it. Windows can go online to look it up automatically, or you can manually select from a list of programs installed on your computer.

    What do you do?

    Use the Web service to find the appropriate program
    Select a program from a list of installed programs.

    If anyone can suggest how I can fix this I would be very happy.

    Thank you

    P.S. This has happened after calling Microsoft this morning and ask for help with another problem with script. The technician who took control of my computer doing something, and since then, nothing works properly!

    Hello

    Method 1
    JSON is a java file. or JavaScript Object Notation, is an open standard based on text designed for the exchange of human readable data. It is derived from the JavaScript scripting language to represent associative arrays, and simple data structures called objects. Despite his relationship with JavaScript, it is independent of the language, with parsers available for many languages.

    If you want to open. You must have Java installed on your computer the JSON file. If you have java installed on the computer I suggest you to try the steps from the following link:

    Change the programs that Windows uses by default
    http://Windows.Microsoft.com/en-us/Windows7/change-which-programs-Windows-uses-by-default

    Method 2
    I also suggest to run virus scan online by using the Microsoft safety scanner.

    Microsoft safety scanner
    http://www.Microsoft.com/security/scanner/en-us/default.aspx

    Note: when you do an antivirus online, you will lose data that are affected by the virus. Microsoft is not responsible for the loss of this data.

Maybe you are looking for

  • How to make photos of camera for mac air2

    Used just plug in camera for Mac and the camera app open. Now with the new air2 nothing happens when I plug. What should I do to import the photos in the camera on my Mac? Thanks in advance for any help. Pat

  • Verify that host VI is running?

    Hi all I came across a situation where I have to check in RT VI that wheather my HOST VI is running or not? I have no idea how to implement it. I would appreciate your help for the implementation of this condition.

  • Renovated E260v2 guard randomly turn on/off

    I had an e260v2 refurbished from TigerDirect (it has an "R" embossed on the back) today, and I turned it on after the battery is about half full. Use the tuner radio for a while (5 min. or more) and all of a sudden it turned off. I pressed the power

  • Windows hangs or freezes.

    Original title: windows 7 freezes, but still run. Please excuse my bad English Hello. I have a very complex problem that is hard to explain and that seems to be very rare: It's the fourth day in a row that my windows laptop crashes randomly for a few

  • How to auto when oracle crashes unexpectedly

    HelloSometimes my oracle xE 11g Forum on CentOS shutdown unexpectedly. How can I automatically restarts when it breaks down or an unexpected shutdown.I know that's not good for restart without reading the newspaper to search for the root cause but ho