|
VB:
Private Declare Function FirstMethod Lib "C:\Premalatha\C++\17_01_06-ACDB_CON_DLL\Debug\ACDB_CON.dll" (ByVal ArgCount As Integer, ByVal Args0 As String, ByVal Args1 As String, ByVal Args2 As String, ByVal Args3 As String) As Boolean
C++:
#include <stdexcept>
#include "acdbcon.hpp"
#include <windows.h>
using namespace std;
bool __stdcall FirstMethod(int argc,char argv0[],char argv1[],char argv2[],char argv3[])
{
char *argv[4];
argv[0]=argv0;
argv[1]=argv1;
argv[2]=argv2;
argv[3]=argv3;
MessageBox(NULL,argv[0],"Filename",NULL);
MessageBox(NULL,argv[1],"Input",NULL);
MessageBox(NULL,argv[2],"Output",NULL);
MessageBox(NULL,argv[3],"Choice",NULL);
CAcdbCon Con;
Con.ACDBmain(argc,argv);
return true;
}
-----------------------------------------------------------------------------
void CAcdbCon::ACDBmain(int argc, char * argv[]) //JLF 10/30/02
{
MessageBox(NULL,"Con:ACDBMain","Func",NULL);
//***************** NOTICE NOTICE NOTICE *****************************
// Always update Software version and the date the changes were made
// for ANY changes made to the tool. For minor changes and fixes,
// update the decimal value, whereas major revisions update the
// first number
const char * Version="2.01";
const char * Date="November 29, 2002";
//Error is true if the the MainEventProcessor method returns with an error,
// otherwise it is false.
int Error;
//MainDriver object which is the user interface driver.
CDriver MainDriver(Version,Date);
//Start the main processing loop.
Error = MainDriver.MainEventProcessor(argc, argv);
//Display that the main processing loop is completed (with errors)
if(Error)
{
cout << endl << "Application terminated with errors." << endl;
//Pause the screen so the user can see the results
int ch = 0;
cout << "Type ESC to Exit";
do
ch = _getch();
while(ch != 27); //search for ESC character
}
};
---------------------------------------------------------------------------
int CDriver::MainEventProcessor(int argc, char * argv[]) //(JLF 10/30/02)
{
MessageBox(NULL,"Driver:MainEvent","Func",NULL);
//Flag is set to TRUE as long as processing is necessary. When the user
// selects EXIT program then Running is set to FALSE.
int Running = 1;
//Operating mode. BATCHMODE reads a script file to control the program.
// INTERACTIVEMODE allows the user to interactively control the program.
// COMMANDMODE the user has entered information on the command line (JLF 10/30/02)
enum MODE_TYPE {SEL_BATCHMODE,SEL_INTERACTIVEMODE,
SEL_COMMANDMODE} Mode = SEL_INTERACTIVEMODE;
try // Exception handler
{
//set up the default paths
strncpy(ToolPath, argv[0], FILENAME_MAX);
if(strrchr(ToolPath, '\\') != NULL)
*(strrchr(ToolPath, '\\')) = '\0';
_getcwd(CWDPath, FILENAME_MAX);
//IF there are command line parameters, run in COMMANDMODE (JLF 10/30/02)
if(argc > 1)
Mode = SEL_COMMANDMODE;
//Processing loop. Repeat until the user selects EXIT.
while(Running)
{
//Mode switch. BATCHMODE reads a script file to control the program.
// INTERACTIVEMODE allows the user to interactively control the program.
// COMMANDMODE the user has entered information on the command line
switch(Mode)
{
case SEL_INTERACTIVEMODE:
{
//Display the message if this is not the first time through here
if(Running != 1)
cout << endl << Message.c_str() << endl << endl;
else
Running++;
InteractiveMode(argc,argv);
break; //INTERACTIVEMODE
}
case SEL_BATCHMODE:
{
BatchMode();
//If called on command line and the file is complete, set up to exit
if(AcftDirection==SEL_TOGGLEMODE && argc != 1)
AcftDirection=SEL_EXIT;
break; //BATCHMODE
}
case SEL_COMMANDMODE: //(JLF 10/30/02)
{
MessageBox(NULL,"Command","Mode",NULL);
CommandLineMode(argc, argv);
//The main loop should run only once, so set the variable to stop
// after this has completed.
Running = 0;
break; //COMMANDMODE
}
default:
{
string Error("internal Mode must be BATCHMODE, INTERACTIVEMODE or COMMANDMODE.");
throw(Error);
}
}; //end of Mode switch
//Option switch. BINARY_TO_HUMAN converts a binary file to a human
// readable file, HUMAN_TO_BINARY converts a human readable file to a
// binary file, SPREAD_COVS spreads the covarience of the Wf P Matrix
// and the P Matrix, BATCH switches from interactive to batch mode, and
// EXIT quits the program.
switch(AcftDirection)
{
case SEL_BINARY_TO_HUMAN:
{
Buffer->ReadBinaryFile(InFilename);
//Do NOT pass the path to be written to the output file
char * PtrNameOnly = strrchr(InFilename, '\\');
if(PtrNameOnly == NULL)
PtrNameOnly = &InFilename[0];
else
PtrNameOnly++;
Buffer->WriteHumanReadableFile(OutFilename, PtrNameOnly);
// Set the Message string to be displayed to the user.
Message="Converted ";
Message+=InFilename;
Message+=" to ";
Message+=OutFilename;
Message+=".";
break; //BINARY_TO_HUMAN
}
case SEL_HUMAN_TO_BINARY:
{
Buffer->ReadHumanReadableFile(InFilename);
Buffer->WriteBinaryFile(OutFilename);
// Set the Message string to be displayed to the user.
Message="Converted ";
Message+=InFilename;
Message+=" to ";
Message+=OutFilename;
Message+=".";
break; //HUMAN_TO_BINARY
}
case SEL_SPREAD_COVS:
{
Buffer->ReadBinaryFile(InFilename);
Buffer->SpreadPMatrix((float)0.249);
Buffer->SpreadWfPMatrix((float).199);
Buffer->WriteBinaryFile(OutFilename);
// Set the Message string to be displayed to the user.
Message="Spread the P matrix of ";
Message+=InFilename;
Message+=".";
break; //SPREAD_COVS
}
case SEL_TRACE:
{
const int SigFig = 5; //The number of significant figures
// of the trace calculations.
double PTrace=0.0; //The value of the P matrix trace.
char PTraceChar[SigFig+1]; //The character representation of the
// P matrix trace.
float WfPTrace=0.0; //The value of the Wf P matrix trace.
char WfPTraceChar[SigFig+1]; //The character representation of the
// Wf P matrix trace.
//Read the binary file
Buffer->ReadBinaryFile(InFilename);
//Calculate the trace of the P matrix and convert it to a string
PTrace = Buffer->TracePMatrix();
gcvt(PTrace,SigFig,PTraceChar);
//Calculate the trace of the Wf P matrix and convert it to a string
WfPTrace = Buffer->TraceWfPMatrix();
gcvt(double(WfPTrace),SigFig,WfPTraceChar);
// Set the Message string to be displayed to the user.
Message="The trace of the ";
Message+=InFilename;
Message+=" file.\n";
Message+="Rated Fuelflow Matrix ";
Message+=WfPTraceChar;
Message+=" (1.25).\n";
Message+="Thrust Minus Drag Matrix ";
Message+=PTraceChar;
Message+=" (2.75).\n";
if((PTrace<2.75)&&(WfPTrace<1.25))
Message+="Learning is VALID.";
else
Message+="Learning is NOT VALID.";
break; //TRACE
}
case SEL_TOGGLEMODE:
{
if(Mode==SEL_INTERACTIVEMODE || Mode==SEL_COMMANDMODE)
{
//Switch mode to BATCHMODE
Mode=SEL_BATCHMODE;
//Open the script file. If the script file is not found
// then throw the file not found exception.
ScriptFile.open(ScriptFileName);
if(!ScriptFile) throw XFileNotFound(ScriptFileName);
}
else //Mode==BATCHMODE
{
//Switch mode to INTERACTIVEMODE
Mode=SEL_INTERACTIVEMODE;
//Set the Message string to be displayed to the user.
Message="The scriptfile ";
Message+=ScriptFileName;
Message+=" processed successfully.";
};
break; //BATCH
}
case SEL_EXIT:
{
//Exit the main while loop
Running=0;
break; //EXIT
}
case SEL_INVALID:
{
// Set the Message string to be displayed to the user.
Message="ERROR - Invalid option";
break; //INVALID
}
default:
{
// Set the Message string to be displayed to the user.
Message="ERROR - Invalid option";
AcftDirection=SEL_INVALID;
break; //default
}
}
}
return 0;
}
catch(string P) //Catch the generic string exception.
{
cout << endl << "ERROR - " << P.c_str() << endl;
return 1;
}
catch(XFileNotFound xf) //Catch the thrown file not found exception.
{
xf.OutMessage(cerr);
return 1;
}
catch(XFileCouldntOpen xf) //Catch the thrown file couldn't open exception.
{
xf.OutMessage(cerr);
return 1;
}
};
void CDriver::CommandLineMode(int argc, char * argv[])
{
MessageBox(NULL,"Driver:Command","Func",NULL);
//Set up the input path
strncpy(InputPath, argv[1], FILENAME_MAX);
if(strrchr(InputPath, '\\') != NULL)
*(strrchr(InputPath, '\\')) = '\0';
//If there are parameters on the command line, process for COMMANDMODE
// First parameter always the input file or script file.
strncpy(InFilename, argv[1], FILENAME_MAX);
AircraftDatabaseFileTypeVersion(); //Determine the direction
switch(InFileType)
{
case SCRIPT:
AcftDirection = SEL_TOGGLEMODE;
strcpy(ScriptFileName, InFilename);
InFilename[0] = '\0';
break;
case BINARY:
case ASCII:
//What type of request is this? BINARY_TO_HUMAN or HUMAN_TO_BINARY
if(InFileType == BINARY)
AcftDirection = SEL_BINARY_TO_HUMAN;
else
AcftDirection = SEL_HUMAN_TO_BINARY;
//Second parameter if present is the output filename
// If output filename not provided, use InFilename with different extension
if(argc > 2)
strncpy(OutFilename, argv[2], FILENAME_MAX);
else
{
strcpy(OutFilename, InFilename);
if(InFileType == BINARY)
strncpy((strstr(OutFilename,".")), ".OUT", 4);
else
strncpy((strstr(OutFilename,".")), ".LRN", 4);
}
break;
default:
string Error("File must be a valid Aircraft Database or Script file");
throw(Error);
break;
} //end of InFiletype switch
};
-----------------------------------------------------------------------------
void CAircraftDataV2::ReadHumanReadableFile(ifstream & instr)
{
MessageBox(NULL,"DataV2:ReadHuman","Func",NULL);
//Temporary character array and integer
char s[128];
int i;
short TempShort;
unsigned short Flap1, Flap2, Flap3, Flap4;
//Tempory pointer to a float and to a integer
float * FloatPtr;
short * ShortPtr;
//Set all the characters in the acft_type and acft_tail_no strings to NULL
for(i=0; i<sizeof(acft_type); i++)
="" acft_type[i]="0x00;
" for(i="0;" i<sizeof(acft_tail_no);="" acft_tail_no[i]="0x00;
" read="" and="" flush="" the="" aircraft="" data="" label="" (ie:="" acft_type,="" acft_tail_no,="" ...)
="" ignoring="" white="" space.="" set="" last="" character="" to
="" a="" null="" terminator="" to="" guarentee="" that="" string="" is="" properly="" terminated.
="" replace="" with="" an="" 0x80.
="" strncpy(acft_type,="" getvalue(instr,s,="" 128),="" sizeof(acft_type));
="" acft_type[sizeof(acft_type)-1]="(char)0x00;
" acft_type[strlen(acft_type)]="(char)0x80;
" if="" acft_tail_no="" ??????="" then="" null.
="" 0x80.="" fms="" requires="" last
="" of="" acft_type="" array="" be="" 0x80,="" so="" it.
="" strncpy(acft_tail_no,="" getvalue(instr,s,128),="" sizeof(acft_tail_no));
="" acft_tail_no[sizeof(acft_tail_no)-1]="(char)0x00;
" acft_tail_no[strlen(acft_tail_no)]="(char)0x80;
" all="" character's="" sent="" must="" upper="" case,="" convert="" upper.
="" i<sizeof(acft_type);="" floatptr="" point="" max_ceiling.="" march="" through="" floats
="" reading="" data.="" labels="" as="" you="" go.
="" max_ceiling;
="" i<7;="" i++,="" floatptr++)
="" *floatptr="atof(GetValue(instr,s,128));
"
="" intptr="" num_engines.="" integers
="" shortptr="&" num_engines;
="" i<13;="" shortptr++)
="" *shortptr="atoi(GetValue(instr,s,128));
" engoutcd.="" engoutcd;
="" i<56;="" at_climb_detected.
="" instr.ignore(64,="" '="" ');
="" instr="">> hex >> TempShort;
at_climb_detected=(char)TempShort;
instr.getline(s, 128); //ignores the remaining values on the line
//Read and flush the aircraft data label and then the at_configured.
instr.ignore(64, ' ');
instr >> hex >> TempShort;
at_configured=(char)TempShort;
instr.getline(s, 128); //ignores the remaining values on the line
//Read and flush the aircraft data label and then the holdspd.
holdspd = atoi(GetValue(instr,s,128));
//Set the FloatPtr to point to the vref_factor. March through the floats
// reading the aircraft data. Flush the aircraft data labels as you go.
FloatPtr = & vref_factor;
for(i=59; i<62; i++, FloatPtr++)
*FloatPtr = atof(GetValue(instr,s,128));
//Read the appraoch and go around speeds and their instruction header.
instr.getline(s, 128);
instr.ignore(128, ' ');
instr >> dec >> Flap1 >> dec >> Flap2 >> dec >> Flap3 >> dec >> Flap4;
approach_speeds = Flap1 | (Flap2 << 4) | (Flap3 << 8) | (Flap4 << 12);
instr.getline(s, 128); //ignores the remaining values on the line
instr.ignore(128, ' ');
instr >> dec >> Flap1 >> dec >> Flap2 >> dec >> Flap3 >> dec >> Flap4;
go_around_speeds = Flap1 | (Flap2 << 4) | (Flap3 << 8) | (Flap4 << 12);
instr.getline(s, 128); //ignores the remaining values on the line
//Set the FloatPtr to point to the spare[0]. March through the floats
// reading the aircraft data. Flush the aircraft data labels as you go.
FloatPtr = & spare[0];
for(i=64; i
|
|
|
|
|
Hi All,
I m stuck with a problem
Can any body solve my problem ,
The problem is how we can add the custom control in the datagrid view column
Means i want to show aa user control in the a datagrid view column lik ethe simple combo box , button etc,
Thanks for ur great help in advance
Hema Chaudhry
|
|
|
|
|
Did you ever figure this out? Have any code? I want to try and put a control with a couple of labels and a checkbox and Ihaven't found any examples of how to do it.
Thanks
|
|
|
|
|
hellow to all .
i am writing in vb.net and useing the vb 6 MASKED Control .
when i try to write to it information from the database ..
i recive this error
Exception from HRESULT: 0x800A017C (CTL_E_INVALIDPROPERTYVALUE).
any help will be appreciated .
|
|
|
|
|
You might want to look at this[^] on MSDN.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi funs of vb.net,
I have rewrited (converted) some code with xyz.dll (C)
form vb6 to vb.net 2005 Ex.
Have change Long types to Integer - of course.
It works. B U T the resuts are differnt ???
I am sure of the vb6 results. The astronomical countings.
They are the same in vb6, c++ and even in vba2003.
Does anyone know something about it?
Mayby the beta version or so?
sbststtswbwgf
|
|
|
|
|
There are not differences between how each handles a 32-bit signed Integer. But, of course, that depends entirely on your code and how it's passing parameters back and forth between languages.
Without any code samples, it's pretty much impossible to tell you what's going on.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi to all,
do you remember when we could make an easy UDP connection with VB 6.0?
we needed only to drag and drop the winsock... one minutes of codes and... we could make two applications "talk together"!!!
Now i have a problem!!!
I want to do the same thing with "Microsoft Visual Studio 2005"... but there is a new way to program that i don't know... even i don't know what is the name/identifier of this new language... (maybe "VB.NET 2005"?)
I have found, on this site, articles/source on UDP connection... but "Microsoft Visual Studio 2005" say that this code is old so it make a convertion... EVEN THOUGH I DON'T UNDERSTAND THE SOURCE!!!
There are a lot more lines of code...
Please Help Me... I NEED A SMALL EXAMPLE (SOURCE FOR "Microsoft Visual Studio 2005") LIKE TWO FORMS THAT CAN CHAT BETWEEN THEM!!!
THAKN YOU ALL!!!
And excuse my english
|
|
|
|
|
Hello!
I developed an application but I intend to write an uninstall app for it. I don't know how I could remove the software from Add/Remove programs section in the control panel with my code.
Any idea would be very helpfull
Thanks.
Bedri.
bckurd@e-kolay.net
|
|
|
|
|
|
|
B Journey wrote: I developed an application but I intend to write an uninstall app for it.
Do you develop your application in vb.net? As far as i know, when you build an installer for vb.net application it also has a property that ask you to allow to have uninstall feature or not. If you allow, after you install an application, the name of your application will appear in the ADD/REMOVE PROGRAM dialog box.
|
|
|
|
|
when u create a dataset at design time the xml schema gets automatically generated. i want to generate that schema in code so that the dataset i am creating comes in the project data of available datasources in the database expert dialog box of the crystal report. can anyone tell me how to do it?
thanks in advance,
lavanya
|
|
|
|
|
I Want to deploy my application through No Touch. But i have two projects client and server which has to be deployed in a single click .I don't know how to implement this pls help me
Regards
Johny
-- modified at 6:00 Monday 23rd January, 2006
|
|
|
|
|
It is simillar to the answer file for windows 2000 and windows xp or an INF file for microsoft batch when you need to install windows 98 with less administrative support. I do not have any code for you but i just give me some idea about this application.
You need to build a single form of collecting an information from the user (name, organization, serial number) and save it to another file after user enter into a specific form. Then write your own setup file to read an information this file. So everything might work fine.
I can't guarantee that it is working or not but I hope it is working like windows does when you need to install by using the answer file.
|
|
|
|
|
Hi Roath Kanel!
My application has these two projects one is windows services and other is outlook Add-inn and now i want to use the one touch deployment to implement my application.When i click the link these two projects has to be deployed
I don't know how to implement this if you have any idea or sample code how to implement this pls fwd it
Thaks in Advance
Johny.R
-- modified at 23:24 Monday 23rd January, 2006
|
|
|
|
|
Hi
How to insert line number in VB6.0.
Ex:
1010 msgbox("Hi")
1020 msgbox("Hello")
1030 msgbox("Hello2")
Paritosh
|
|
|
|
|
Why??? It's such an outdated concept. You really shouldn't be doing it.
In properly written code, you just don't need them at all.
Labels, still an outdated concept, can be done like this (IIRC):
code
code
code
Label3:
code
code
code
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi Guy's
I want to Filter the time which is not between given two Times.
i mean i want to filter the Time which is not between 07:00:00 Am and 10:00:00 am.
Sasmi
|
|
|
|
|
think this is your answer.
select field from table where time(field) between parameter1 and parameter2
try this out.
regards,
Lavanya
|
|
|
|
|
I'm guessing that the column storing the time is a datetime or smalldatetime. Also, as you didn't say, I'm assuming you are using SQL Server 2000. In this case you need to extract out the time portion from the date portion and filter on that.
Something like this might work:
SELECT * FROM MyTable
WHERE ((datepart(hours, timeColumn)*3600)+(datepart(minutes, timeColumn)*60)+datepart(seconds, timeColumn))
NOT BETWEEN 25200 AND 36000
The calculation in the WHERE clause represents the timeColumn being converted to seconds since the start of the day.
"timeColumn" is the name of the column that contains the time information.
The numbers after the BETWEEN represent 7AM and 10AM in seconds since the start of the day.
Does this help?
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
-- modified at 13:45 Monday 23rd January, 2006
|
|
|
|
|
I'm currently developing a application where the end-user must be able to arrange "fields" in a "panel" via drag'n'drop much like columns are often re-arranged in grid header at runtime.
The "panel" must support arranging the order of the "fields" by the end-user and also support adding and removing "fields" from the "panel" from a "stock panel" which contains all available "field"-items.
I must be able to implement my own "Field"-item control so I can't just use a normal grid.
I'm currently looking into using the new FlowLayoutPanel control but it doesn't support drag'n'drop of items in runtime.
Any advice how to implement such a feature ?
I'm open towards commercial 3. party components but if this feature can be done for free, it would be best
|
|
|
|
|
"problem" solved.
I have implemented my own drag'n'drop functionality into the FlowLayoutPanel.
|
|
|
|
|
In my application,
All the controls in the form is setted to Arial, 8.25pt.
But one of user computer set the DPI setting to Large, 125DPI.
But not normally 96DPI.
All my font in the form is enlarged.
Most of text of controls are outside the boundary.
How can I set the form will not affect by this factor like all window application ?
|
|
|
|
|
Have you found a solution to this issue? I am running into the same issue myself. Any help will greatly be appreciated!
|
|
|
|
|