I have written some code to make two partitions in USB flash drive. When I ran it I am not able to make partitions on usb. What'll be the problem in this code.
Code:
/-------------------INITIALIZE AND PARTITION-------------------------------//
#include "stdafx.h"
#include <Windows.h>
#include <stdio.h>
I am trying to write a to a specific sector in a flash drive. The problem is that it will only allow me to write to sectors 0 to 15. When I try sector 16 or higher nothing happens, but in sector 0 to 15 is is working fine.
#define BUFFER_SIZE 512 int main(void) { FILE *volume; int k = 0; long long sector = 0; char buf[BUFFER_SIZE] = {0};
I want to read a file from my flash drive called text.csv. However, I cannot even open the port where my flash drive is connected. This is the code that I am using, but I get error since the first part. When I run the program it says "fopen Error". I am using Ubuntu 12.04.
I'm currently involved in an embedded (cortex M3) C++ project where we're about to run out of flash.
A quick check of the map file give that, in our case, the destructors consume about 10-15% of the available space. Since we're allocating all things that are needed at startup but never delete anything (both a requirement & also impossible due to the lack of a proper memory manager) the thought of getting rid of all destructors in the target build is appealing.
I know that this question is somewhat crazy/desperate but is there a safe way of telling gcc not to emit any code for destructors? If so, can that be made in such a way that a linker error catch for instance mistakes such as creating an object on stack?
I have a flash movie that is bigger than the axShockwaveFlash placeholder that plays it. The axShockwaveFlash placeholder expands to the size of the movie.
I have found a website at [URL] but asp is totaly different from c#.
How can I make the movie shrink to fit in the axShockwaveFlash placeholder?
My specific request is for retrieving values that are stored to a CompactFlash card. I am able to store values (we call them recipes) to the CompactFlash card as .csv file. I just haven't been able to figure out the code to retrieve this information back to the touchscreen.
Code: // Create a new folder if it doesn't exist CreateDirectory("/recipes"); //Create the file if it doesn't exist CreateFile("/recipes/recipe.csv"); //open the file hfile = OpenFile("/recipes/recipe.csv", 2);
[Code]....
Now with that said, I would like to retrieve these values from the .csv file.
I'm making a flash card type console application using visual studios 2013. The flash cards contain character that I can display using unicode. So far I am looking at about 200 characters across 2 unicode blocks which I don't want to hard code into my arrays. I thought of initializing my arrays using a loop. The only problem is I don't know how to add in hexadecimal. So is there a way to initialize my array without having to input 200 values my self? Also is hexadecimal addition possible without me having to write a function for it?
I want some simple code which will return only the DriveInfo from one drive. I have the below code but it isn't displaying what I expect it to display, I have a feeling i'm using Linq wrong!
var dname = from n in System.IO.DriveInfo.GetDrives() where n.Name == "F" select n.VolumeLabel; richTextBox2.AppendText(dname.ToString() + " ");
The above should return the devices VolumeLabel which is in port F.
I would like to be able to safely eject a USB drive (in Windows) when user selects that drive in a listbox and clicks the Eject button in an MFC dialog app. Any functions or (link) that would be up to date (i.e. compatible with Windows 8)?
I would like the user to insert a CD into their computer and click on an button on my application that allows them to read the CD-ROM and find a specific file type, e.g. csv, and then grab the info in the csv file.
I already have my StreamReader setup grabbing a filepath.
Now I am just wondering...how do I detect the CD-ROM and how do I grab the filepath of the only CSV file on the CD-ROM?
What's behind detecting a CD-ROM and grabbing a specific file type from a CD-ROM?
I heard about DriveInfo
However, that only allows me to detect a drive but not look at it's contents.
I am trying to save the excel file in D:/newfolder. but the file saving as newfolderFilename. The newfolder is already created in D drive. File save path i am getting from textbox ....
Not much to go wrong here, right? As long as I have the correct permission to write in the folders and the folders exists, this would normally go smooth. But for some reason it only copies the file. The source file still exists, but it has successfully copied the file to the destination folder. No exceptions has been thrown or anything... but the file still exists in the source directory
I then changed the code to the following:
System.IO.File.Copy("Y:TempFile.txt", "Y:Temp2File.txt"); System.IO.File.Delete("Y:TempFile.txt"); Console.WriteLine("See mommy, no Exceptions");
As expected the file copies correctly, but the delete command is completely ignored. The file is not deleted, but the Console.WriteLine command is called
I'm running the application as the logged in user. The user has permission to delete the file. If I try from Windows Explorer, the file is correctly deleted. Unfortunately my application refuses to delete the file and even worse, it will not even throw an Exception.
Write a program that is able to save a list of items such as books, CDs, or DVDs and the items that are saved must have attributes associated with them. For example a book has a title, author, publisher, and ISBN.I would like to create a program that is able to save the database of items to a file on the hard drive and also retrieve it from the hard drive.I have this for a start of how to set up a storing program.
#include <iostream> #include <iomanip> using namespace std; int main () { const int arraySize = 10; int a[arraySize] = { 2, 6, 4, 10, 12, 89, 68, 45, 37 }; int i, hold;
I am creating small application using c#.net.I removed all image tag using regular expression no I want to remove all video file and flash file also in source code of webpage.
so far I have tried this ...
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text;
The project is about reading data from PIC and display the data on the dialogue created by the MFC GUI of Visual studio 2010. There are 4 data need to be displayed (2 weight and 2 angle). the data will be display on the edit control box on the dialogue.
I have try to solve the COMPort and Readdata issues many times, but I'm fail. I have read many sources and implement the source codes... They are never work....
The detail about the issues that I need to solve is clearly mentioned on the main dialogue.cpp. Take a look to an uploaded zip file that I have attached.
I heard that you can't use it with express, but that doesn't seem right... Can you use it with Codeblocks, at least? I just hate the Qt Creator IDE. I don't like the UI... all I want to do is code Qt. I don't care much for the GUI editors.
I am trying to create a OCX from a C++ dll., Here's the scenario I have a C++ dll and this dll needs to be called in VB.net program my boss want's me to create an OCX out of this.
C++ dll and use it in a VB.net class library, apparently I have created an OCX but it requires a form but the VB.net program is a class library.
In a C++ project, I need to call a C# created COM object (as a .dll)
Is there a way to use such a COM object without having it be registered in the registry?
The C# COM dll is just a "go between" our C++ code and a .NET library, there's no "COM contract" of any kind, the COM interfaces change each version. The fact it's COM and needs registration is annoying because it makes it hard to have multiple versions of our software installed (needed under some circumstances) and running at the same time.
I'd like a way to not have any registration at all. And just be able to do a LoadLibrary("c:TheRightPathcom.dll") of the right dll and then get going from there.