C/C++ :: Create A Autocad Script File?
May 2, 2014
i am writing a program in Microsoft Visual C++ Express. The goal is to create a Autocad script file with this program. The extension of the script file is .scr
Now I first want to create the script file, then edit is and after that save it at a specific location. I want to activate this proces with a button. I have tried many tutorials about creating files but none have worked yet. My questions are:
- How do I create the script file?
- How do I edit it?
-How do I save it?
- Where to put which code?
// PDFScripper.cpp : main project file.
#include "stdafx.h"
#include "Form1.h"
#include <Windows.h>
#include <stdio.h>
#include <tchar.h>
#include <WinBase.h>
[code].....
View 5 Replies
ADVERTISEMENT
May 2, 2014
I want to write a visual C++ program to create a script file for Autocad. A script file has the extension .scr
The goal is, to create the file, write information in it and close the file and save it at a specific location. How can I create the file? I have tried the CreateFile function but I can not make it work. I use the Visual C++ express version as a IDE.
The question that I have is: how does the function look like? Which header files should I use and where should I put the include statement?
// PDFScripper.cpp : main project file.
#include "stdafx.h"
#include "Form1.h"
#include <Windows.h>
#include <stdio.h>
#include <tchar.h>
#include <WinBase.h>
using namespace PDFScripper;
[Code] ....
View 2 Replies
View Related
Apr 10, 2014
I need to create a project that create a automated backup of a file.
i will get the file from C:/Folder/file.exe and move for a other created folder, but.. in every time that user make this backup, a folder will be created with year, month and date, like: C/Folder2/2014/April/16:42/file.exe.
View 4 Replies
View Related
Mar 15, 2013
The Objective Of This Program Is To Create A File To Write Text And Read Back The File Content. To Do That I Have Made Two Function writeFile() To Write And readFile() To Read.The readFile() function works just fine but writeFile() doesn't.
How writeFile() function Works? when writeFile() function Execute It Takes Characters User Type And When Hit Enter(ASC|| 10) It Ask "More?(Y/N)" That Means What User Want? Want To Go Next Line Or End Input?
If "Y" Than Inputs Are Taken From Next Line Else Input Ends.
But The Problem Is When Program Encounters ch==10 It Shows "More?(Y/N)" And Takes Input In cmd variable.If cmd=='Y' I Mean More From Next Line Than It Should Execute Scanf Again To Take ch I Mean User Input.But Its Not!!! Its Always Showing "More?(Y/N)" Again And Again Like A Loop.
Code:
#include <stdio.h>
void writeFile(void);
void readFile(void);
int main(){
[Code].....
View 5 Replies
View Related
Feb 17, 2015
I am interested in creating a file of a given size and then randomly accessing the file to populate it. Is there a way to quickly create, for instance, a 4 GByte file in C++, initially populated with garbage?
View 4 Replies
View Related
Jul 14, 2012
I have a folder "pics" in g: drive. There I want to create some text.txt file. Thus, the final path is "g:pics ext.txt".
How can I do that?
View 3 Replies
View Related
Oct 10, 2014
How do you create a save file for a game, that is not a separate file? Specifically I am using code::blocks and sfml 2.1 to make a game and it saves to a text file at the moment. My problem is that it is very easy to modify the text file, and it is annoying to have to copy and paste several files if you want to use a copy of the game. I have a feeling that it may be to do with resource files, but I'm not exactly sure how to get these to work or whether you can modify them dynamically.
View 6 Replies
View Related
Sep 30, 2014
I think this code should create a test.txt file but I cannot find it ?
Code:
#include <iostream>
#include <fstream>
using namespace std;
int main() {
ofstream ofs;
ofs.open ("test.txt");
ofs.close();
return 0;
}
View 4 Replies
View Related
Jan 26, 2015
I want to create a program that would take an AVI file, alter each frame (ex: change contrast, invert colors, etc.) and dump a new AVI. I've wrote a simple program for this experiment that loads up the header information from the video and dumps it. It also dumps a list of the frame data chunks within the 'movi' chunk.
The info I've gathered from coding this:
1. The recommended buffer size for each type of stream (vids, auds, etc.) is the size of the largest frame of corresponding type, plus 1 or two extra bytes.
2. numFrames in main header is the total number of frames for all types of data (video,audio,etc.) The 'length' value within stream header of type 'vids' is the number of video frames. The sizeImage value within BITMAPINFOHEADER is 921600 (==640*480*3) and the specification states that, quoth, "This can be set to 0 for uncompressed RGB bitmaps."
3. This video uses DIVX encoding.
Now my problem is this: How do I get the data within each video frame in a simple BMP like format? Even the uncompressed frames (with chunk id 'nndb') have variable sizes...let alone the compressed ones.
Information about a software that converts AVIs to a format with fixed sized uncompressed frames. Or at least some information about the frame decompression techniques.
Here's a dump made by the program for a 9 sec, 640x480 video I recorded from Pokemon. (Without the frame dump that is, it'd have made the post too long.)
Code:
AviMainHeader
-------------
size = 56
usecPerFrame = 66666
maxBytesPerSec = 7680000
padSize = 0
flags = 0x00000810
numFrames = 162
initialFrames = 0
numStreams = 2
[Code]...
View 4 Replies
View Related
Jul 26, 2013
How do i create a data file?
View 2 Replies
View Related
Feb 11, 2014
I now have a file with X, Y, Z and Intensity (0-1) of all the pixels. I want to create a .bmp file (grayscale) with this information in C++. How to do it?
View 1 Replies
View Related
Oct 22, 2013
Any good/solid example on how to create a header file?
View 2 Replies
View Related
Jul 15, 2014
Im having problems with this little function im making
for some reason the texture dont get created (messagebox never gets called)
Im trying to pass a BYTE array of a image to the function
void AddTexture(BYTE* texture)
{
LPDIRECT3DTEXTURE9 Direct3DTexture = NULL;
if (D3D_OK == D3DXCreateTextureFromFileInMemory(pDevice, &texture, sizeof(texture), &Direct3DTexture))
{
MessageBoxA(NULL, "created", "created", MB_OK);
}
}
View 6 Replies
View Related
Feb 18, 2014
For some unknown reason when i try the following code it doesn't create a file. (the program will simply get two inputs from the user and then use http to obtain the html/php text and then output it to a file)
code:
#include <SFML/Network.hpp>
#include <iostream>
using std::cout;
[Code].....
View 3 Replies
View Related
Apr 22, 2014
My problem is that I have to modify only some specific details in a txt file (actually it is a wrl file but it can be considered as a txt file). There is a lot of text there but I just need to modify the point coordinates and leave the rest of the text as it is. Reading the "sample file" at some stage we will see some blocks that look like the below:
coord Coordinate {
point [
# bottom
-1.0 -1.0 1.0, #vertex 0
1.0 -1.0 1.0, #vertex 1
[Code] ....
where the numbers are (X,Y,Z) coordinates. What I have to do is to change those figures for (X,0,sqrt(X^2+Z^2)) points. Therefore the expected result (test file) will be as follows:
coord Coordinate {
point [
# bottom
-1.0 0.0 1.4142, #vertex 0
1.0 0.0 1.4142, #vertex 1
[Code] .....
So in my opinion it can be good to have two files: sample.txt and test.txt where the sample file will never be modified whereas the test.txt will be the same as sample.txt but including the modifications as explained above. The idea can be to read the sample.txt, store the info and then start copying each line in the test file until we get to the points coordinates (which needs to be modified) and continuying with this process until the next set of coordinates.
The problem is that I do not know how to change x,y,z coordinates from the sample.txt to (X,0,sqrt(X^2+Z^2)) and to copy them in the test.txt. Please see some code below and the sample.txt file attached.
//Read a Text File///////////////////////////////////////////////////////////////////////////////////////////////////
using System;
using System.IO;
namespace readwriteapp {
class Class1
[code]....
View 4 Replies
View Related
May 20, 2013
I'm trying to create a Makefile for a single fie ( mycod.c)
What is the syntax?
View 2 Replies
View Related
Jun 27, 2013
I want to create three files whose names are same but extensions are different. I have to take the name from user. I tried following code but it didn't worked ...
Code:
printf("Name of the file:"); scanf("%s",name);
printf("Format of Input file:");
scanf("%s",ext);
f1=fopen(name.ext,"r");
f2=fopen(name.dat,"w");
f3=fopen(name.src,"w");
f4=fopen(name.RMH,"w");
View 1 Replies
View Related
Jan 2, 2013
I am trying to create an array with the size of the first value of one file wich is the same of the first line because the first line only have one value. Here is how i am trying to do it ...
FILE * fich;
int test;
fich=fopen(nome_ficheiro,"r");
fscanf_s(fich,"%d",&test);
int np=test;
No*aux=primeiro;
[Code] .....
View 3 Replies
View Related
Dec 5, 2014
When I write the Ctor as follows, I get an Error: Invalid Sharing Flag 0 (That happens when file exists or does not exist)
File::File(const string& file)
{
m_file.open(file, std::ios::out, std::ios::app);
}
When I write the Ctor as foolows, I manage to open / create a file.
File::File(const string& file)
{
m_file.open(file);
}
What is wrong with option #1?
note that m_file is a data member of type ofstream
View 1 Replies
View Related
Jun 10, 2014
I have created a desktop application using c#.net in visual studio 2005 and sql server 2005, i have created a setup file also but i dont have database in it.. how to include or attach the database file into the project so that it works well in the client machine.....
View 1 Replies
View Related
Jan 26, 2015
I have an assignment where I have to create an image and output it as a .ppm file. It has to have a black background and have some letters in a different color. My professor told me that my .ppm header should have p3 600 300 255 and P6 600 300 255(what this means, think it sets up the width x height which should be 300 x 600).
This is what I have so far:
#include <iostream>
#include <fstream>
using namespace std;
int main() {
struct pixel {
unsigned char red;
[Code] ....
Problem in first for loop and what it should look like inside of the for loop, after that I should be able to figure this out... with the fstream (how to output the results in a .ppm file).
View 1 Replies
View Related
May 15, 2013
I have a table in my database that has a 3 fields.
RuleID | RuleName | Rule
the ruleID is a randomly generated string of characters, RuleName is the name the user gives to the rule, and the Rule field is about 600 characters long and is just XML text.
I want to read that Rule field from the database and use it inside the function below.
private static List<MenuItem> LoadRules(bool evaluationType)
{
//string path = HttpContext.Current.Server.MapPath(string.Format("/Rules/{0}/{1}/", ip, evaluationType ? "Evaluation" : "Execution"));
[Code]...
This function loads an xml file from a static location and parses out some information to a context menu.
BUt i'm culeless on how to have the function read the xml info found inside my database.
View 1 Replies
View Related
Dec 28, 2013
I am currently having issues with the following code when trying to create a excel file using C#. This is the code that I have at the moment.
oXL = new Microsoft.Office.Interop.Excel.Application();
oXL.Visible = false;
oWK = (Microsoft.Office.Interop.Excel._Workbook)(oXL.Workbooks.Add(System.Reflection.Missing.Value));
oWK.SaveAs(path + "" + fileName);
oWS = (Microsoft.Office.Interop.Excel._Worksheet)oWK.Worksheets.get_Item(1);
oWS.Cells[1, 1] = "Student ID";
oWS.Cells[1, 2] = "Student Name";
oWK.Save();
The line that I am having issues with is
oWS = (Microsoft.Office.Interop.Excel._Worksheet)oWK.Worksheets.get_Item(1);
If I remove it, I am able to create and save teh workbook in the directory. However, I want to make some changes on a worksheet, and that is where the issue is. I have also tried using the line of code:
oWS = (Microsoft.Office.Interop.Excel._Worksheet)oWK.Worksheets[1];
This line had no luck either. The issue I am having is the error regarding InvalidOperationException: Dynamic operations can only be performed in homogenous AppDomain.
View 2 Replies
View Related
May 11, 2014
I have created a MFC application on Visual c++ 2012. My computer work in Win 7 - 64bits. When I see many tutorial about making the executable file which is independent on .dll library (by changing Configuration Properties ->C/C++->Code Generation->Runtime Library ->Multi Threaded Deburg (MT/d)) the compiler becomes error then I can not get the result as tutorial on internet.
Is there any other way to make the .exe file for this?
View 4 Replies
View Related
Apr 12, 2013
I just can't seem to find how to create a header file and where I can change the value of the variables. It sounds simple.
View 12 Replies
View Related
Feb 13, 2014
My objective is to create a file and save some text in it. But the twist is that file should be created in pdf format.
I have written following code:
Code:
#include<stdio.h>
Code:
int main() { FILE *fp;
char ch;
fp=fopen("file.pdf","w");
fprintf(fp, "%PDF-1.3"); //to initiate data storage in pdf file
printf(" Enter data to be stored in to the file:");
while((ch=getchar())!=EOF)
putc(ch,fp);
fclose(fp);
return 0;}
Now my file is created in pdf format, but when I open it by double click on it, it is not open and gives the message like: "Error in opening document. This file is damaged and could not be repaired."
View 1 Replies
View Related