|
What happened when you Googled for "C++ application development"?
|
|
|
|
|
Yes.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
|
Hi, How are you?...i hope you are doing fine... i want to ask is there any built in function to get on exact line in a file? Like:
FILE DATA:
1)Start
2)Mid
3)Username
4)END
i want to get the pointer of file handler on 3 so that i can read that specific line....
or Can we use Seekg.(); function in this case? Kindly help please
|
|
|
|
|
I don't know of such a function. If each line ends in an '\n' , you can use std::getline to read each one and count up to the line you want.
seekg moves by a specified number of characters, so it won't help unless lines are padded to a fixed length.
|
|
|
|
|
The simplest way to do this is to read the file line by line and check for the data that you are interested in. Remember a text file is just a stream of characters with no structure so you cannot easily use file positioning to get to a particular item.
|
|
|
|
|
If you have questions or comments then please use the Reply link, not the Email.
|
|
|
|
|
but i want to privately message you dont want leak my code please check the inbox kindly ... Thank you
|
|
|
|
|
Sorry, all help provided by CodeProject members is done in public through the forums on this website. If you want private help then you are in the wrong place.
|
|
|
|
|
Oh, this explains why I got an email that contained code but couldn't find the same message on this board.
Sorry, I don't do code inspections. If you don't know how to use a debugger, you need to learn now. The days when I wrote code with very few errors are gone. I wouldn't be able to do anything without a debugger now. They're so much better and easier to use than they were 40 years ago that I just focus on the design and then use the debugger to fix the details that I got wrong.
|
|
|
|
|
Okay may be i disturbed everyone here for nothing... I'm really sorry for stupid questions. I do actually know how to debug you sir when you get stuck only then you ask for help... but that debugger get the job done after 7 hours ... and Richard's steps may be helpful but it is very difficult for me to understand it you know... Anyways
Thank you for your help, i appreciate your help 
|
|
|
|
|
If you can't write a function to search for a specific character in a text file, ('\n'), counting how many times you see that character, your code isn't worth hiding.
|
|
|
|
|
I am creating a program where if an action occurs then a message box through visual basic script (.vbs). I plan to do I through a fstream file.
if (statement)
{
open fstream file }
|
|
|
|
|
And what is your question?
|
|
|
|
|
|
Probably, yes.
What program/app should execute this VB script?
|
|
|
|
|
|
VS is not to "execute", it's just to design!
Please, explain more carefully what you are going to do with your VB script. And what for?
|
|
|
|
|
|
Why on earth would you want to use a VBScript from C++ to show a messagebox?
|
|
|
|
|
Hello Folks,
Can anyone please help me to solve this runtime issue I am facing while running the application in debug mode? the error is as follows:
Debug Assertion Failed!
Program: C:\WINDOWS\SYSTEM32\mfc140ud.dll
File: f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\occcont.cpp
Line: 925
For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.
The application is breaking at
ASSERT(IsWindow(pTemp->m_hWnd)); line in occcont.cpp file. Thanks in advance.
|
|
|
|
|
It means that window handle (pTemp->m_hWnd) is NULL. So this window does not exist.
Look at the call stack to find which line of your code causes this assertion failure.
|
|
|
|
|
It is a reasonable guess that pTemp->m_hWnd is not a valid Window handle. How that came about is impossible to guess. You need to use your debugger to gather more diagnostic information.
Also there is some information at Debug Assertion in occcont.cpp Line: 926[^] which may help. But either way this looks to be a Microsoft problem, so you should report it (with full details) to them.
|
|
|
|
|
Good Morning everybody.
I'm developing a program in C++.
It is supposed that the program has to read from excel and write the data in a .txt file. It has to do that during 10 minutes, and after that save the .txt and start doing it again.
How can I do the timer?
May you help me please?
The program I write is this one: (Not sure if is correct)
#include
#include
#include
#include
#include
#include
using namespace std;
struct vehiculo
{
char VIN[8]
char hora[19]
};
int main()
vehiculo cocheentrante
{
File *F;
File *G;
F = fopen("C:\Users\Ford\Usuarios\Cristales\VINES.csv", "rt");
if (F == NULL)
{
cout << "No se pudo abrir el archivo de entrada. \n";
}
else
{
cout << "El archivo se abrio correctamente. \n";
}
G = fopen("dd_mm_aaaa__hh_mm_ss.txt","w");
if((G = fopen("dd_mm_aaaa__hh_mm_ss.txt","w"))!= NULL)
{
while(!feof(F))
{
fgets(VIN,8,F);
fgets(hora,19,F);
fprintf(G, "%s %s", &VIN, &hora);
}
}
fclose(G);
fclose(F);
}
modified 17-Jun-20 5:31am.
|
|
|
|
|