|
Unless the array is always the same size, the first thing you need to do is write the array bounds, so you know what to do with the data when you read it. Then you can read it in, a single number at a time, or a row at a time if you'd like.
Christian Graus - Microsoft MVP - C++
knapak wrote:
SORRY FOR THE REPEAT PLEASE RESPOND TO THIS ONE
OK - please delete the other one...
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi guys
I'm still strugling with the problem of reading a huge file in the most efficient way. I was suggested last week to "read the file into memory as one big chunk". I think that the advice refered to reading the data in binary format instead of text. Cool... so first I have to translate my text files into binary and then read them... Problem is that all examples that I've found refer to either read a single number or things such as a struct with phone directory...
How about reading a 2 dimensional array of doubles as text, save it as binary and then load it into another array after reading the binary file???
examples???
Thanks a million.
|
|
|
|
|
Unless the array is always the same size, the first thing you need to do is write the array bounds, so you know what to do with the data when you read it. Then you can read it in, a single number at a time, or a row at a time if you'd like.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi,
can someone explain a line in the .RC file that accompanies resource definitions in VC++ 6.0?
I have a dialog that has the line:
FONT 8, "MS Sans Serif", 0, 0, 0x1
I also have seen another version of this (seen when merging code changes with another developer) that doesn't have the numerics:
FONT 8, "MS Sans Serif"
curious on this - thanks for explanation.
Johnny
|
|
|
|
|
FONT pointsize, typeface, weight, italic, charset
RC Compiler Syntax[^]
Cheers,
Tom Archer - Archer Consulting Group
"So look up ahead at times to come, despair is not for us. We have a world and more to see, while this remains behind." - James N. Rowe
|
|
|
|
|
"FONT pointsize, typeface" is used in DIALOG templates
"FONT pointsize, typeface, weight, italic, charset" is used in DIALOGEX templates.
Note that unless your code explicitely manipulate the dialog template (which is very unlikely), you don't have to worry about whether a regular or extended template (DIALOG/DIALOGEX) is used. Both formats are handled correctly by all Win32 versions of Windows and by MFC.
HTH,
Serge.
http://www.apptranslator.com - Localization for your Visual C++ apps
|
|
|
|
|
I know how to call a WHS from a file using the cscript application. However, does anyone know how to execute script from memory that has been passed to my application? (Auditing rules strictly forbid me from writing the script to disk first.)
Cheers,
Tom Archer - Archer Consulting Group
"So look up ahead at times to come, despair is not for us. We have a world and more to see, while this remains behind." - James N. Rowe
|
|
|
|
|
If there's some interpreter library for the scripting language you're using you could use that obviously. If there is an executable on the system that can read the script via the command line you could obviously attempt that (Pending command line length).
The other method I can think of is that if the executable that interprets the script uses the standard input handles; you simply need to create that process and replace the standard handles then feed the process the script.
I'm just talking in general I don't know any specifics about any particular scripting language.
8bc7c0ec02c0e404c0cc0680f7018827ebee
|
|
|
|
|
Tom Archer wrote:
I know how to call a WHS from a file using the cscript application. However, does anyone know how to execute script from memory that has been passed to my application?
Unfortunately, neither cscript or wscript allow you to do this. The only way I know of to get around this is to embed the WSH into your application. The WSH interfaces allow you to execute a string.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
you can try using msscript.ocx. just create an instance of the ScriptControl class, access it through IScriptControl interface, feed the script to it using AddCode() method, and execute it with Run() method. If you are interested, i can send you the source code for a class which wraps this functionality.
|
|
|
|
|
I would absolutely be interested. Please do send me the code.
Thanks!
Cheers,
Tom Archer - Archer Consulting Group
"So look up ahead at times to come, despair is not for us. We have a world and more to see, while this remains behind." - James N. Rowe
|
|
|
|
|
i tried to send you an e-mail from codeproject site, but it crashed twice (although it is possible that the mail was successfully sent).
could you please provide some e-mail address so i can send you the code, because i'm not sure if the formatting will be preserved if i just paste it in. you can try to send me an e-mail with your address, you might have more luck than i did
|
|
|
|
|
Hi,
I am busy with developing an ActiveXControl for analysis of data from a Database.
One option shall be the visualization of data as a chart. Therefor I would like to use e.g. the ActiveX-ChartControl from MS (the MSChart Control).
How can I create during runtime an ActiveX Control like MSChart in an ActiveX Control?
Thanks,
Thomas
|
|
|
|
|
can any body help me with timing method to have clock into a program and how can i make precise delays???
thank you
nasa67
|
|
|
|
|
|
how can i save data into file then produce a graph sine wise from data ,please help urgently
nasa67
|
|
|
|
|
nasa67 wrote:
please help urgently
OK, I am being as urgent as I can.
You need to draw a graph, are you using VC6, or a more recent version ? If you're using a more recent version, you have GDI+ built in, otherwise you need to use GDI ( which is not terrible ), or download a Platform SDK. MSDN is loaded with info on how to use both GDI and GDI+.
To save data into a file, use an ofstream. If you google ofstream, you'll find all the info you need.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi, I wrote a DXF <-> SVG converter, and may be you can use XML (Scalable Vector Graphic) and use Explorer patch to draw the graphs or DXF (AutoCAD files) and a DXF free viewer.
Good luck!
|
|
|
|
|
|
I understood you could mix languages. I created 1 solution with 2 projects with the following code: (Original code came from VAX/VMS C, cut to code below, C# code from application I want to mix it with). (CSServer project compiles clean).
C# routine:
using System;<br />
<br />
namespace CSServer {<br />
class CSClass {<br />
<br />
#region Application Start<br />
<br />
static public void Enter_CSServer() <br />
{<br />
int tmp;<br />
Console.WriteLine("Hello World (C#)");<br />
Console.WriteLine("Value={0}",tmp);<br />
} <br />
#endregion<br />
<br />
} <br />
}
CPP Routine: (startup project)
#include "stdafx.h"<br />
<br />
#using <mscorlib.dll><br />
<br />
using namespace System;<br />
<br />
int _tmain()<br />
{<br />
Console::WriteLine(S"Hello World(CPP)");<br />
<br />
CSServer::CSClass::Enter_CSServer();<br />
<br />
Console::WriteLine(S"Goodbye Cruel World (CPP)");<br />
return 0;<br />
}<br />
int Do_Call_Back(char *str, int *value)<br />
{<br />
Console::WriteLine(str);<br />
*value = 1;<br />
return(1);<br />
}
I get routine-not-found on Enter_CSServer. Seems like it's related to the NameSpace of CSServer and then the class CSClass; If I add a
using namespace CSServer { .....code... } then it only finds the routines inside the namespace.
Scott Krusemark
330-966-1231
scott@askent.com
Scott Krusemark
330-966-1231
|
|
|
|
|
Drusemark wrote:
I understood you could mix languages.
If you're using managed C++, then you should be able to create a dll which can be loaded into C#. The other way to do it is to use COM, which can also be imported into a C# project.
If the C# is in a dll and the C++ program is being run, then the same applies, you can write COM servers in C#, or you can use managed C++ to import the C# dll ( I believe, I've never done it ).
If you're not using managed C++, then the C# code needs to be accessed via COM.
There is a managed C++ forum, that may be a good place to ask this, although it's certainly more visible here.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
This is a redirection of the original question.
The bigger problem (from which this code was extracted) is to port a
standalone process from the VAX/VMS world written in C that needs to handle multiple TCP/IP connections simaltanously. I had found a nice chunk of code (a rewritten chat server) in C# that I thought I could mix and match.
Do you know of a sample set of C code that can handle multiple similtanous connections into a process, where I can get the data from the inbound and send out new messages (not necessarily a reply). The data inbound is from a chemlab (chemistries) and the outbound is a message like 'a sample with ID <xxxxx> is coming to the lab'.
BTW your answer helped a lot, it made me understand the complexity level of what I was attempting.
|
|
|
|
|
Above message is from Drusemark - I wasn't logged in. Sorry.
scott@askent.com
Scott Krusemark
330-966-1231
|
|
|
|
|
Anonymous wrote:
Do you know of a sample set of C code that can handle multiple similtanous connections into a process
Sorry no, I don't.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Nish (CodeProject editor) and I co-authored the only book on the subject of "mixed-mode" programming.
It's called Extending MFC Applications with the .NET Framework[^] and specifically illustrates how to mix native C++ and .NET code.
Cheers,
Tom Archer - Archer Consulting Group
"So look up ahead at times to come, despair is not for us. We have a world and more to see, while this remains behind." - James N. Rowe
|
|
|
|