|
hi
i am developing the vb.net desktop application. actually zip file which contains the access db file is stored on the ftp server. so now i want to download the access zip file from the ftpserver and then unzip the file and store the records to the sql server.
does any one can help me.
for the entire process i need to write the prog.
i dont know how to start and do.
please give the code for the same.
so first give the code for downloading the zip file from the ftp server.
and then how to unzip file and store the records in to the sql server.
Thanks in advance.
Thiru
|
|
|
|
|
LOL - another VB programmer who can't read.
Dude, this is the managed C++ forum.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
I want to add a button on windows Save As dialogue tool bar. I need information (name, path) about current document (which send Save As dialogue). From any documents I want to save them automatically in a fixed folder(s).
Best regards,
mihai_chioariu
|
|
|
|
|
You're doing this in managed C++ ?
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Hi Folks!
IJW doesn't seem to work for me.
In a managed class (__gc) the use of
|char *buffer1 = new char(16);
or
|char *buffer2 = new char[16];
or even
|char *buffer3 = (char*) malloc(16);
raises a System.NullReferenceException.
For new to work I linked against libc.lib.
Any help would be very much appreciated!
Thanks,
Eric
p.s. I could avoid this altogether if I could communicate with an unmanaged application through a named pipe, but I could not find named pipes in the framework. Aren't there any?
|
|
|
|
|
Are you trying to convert a String object in .NET into its data equivalent for usage in an unmanged application?
If so, you should read the documentation on Interop marshalling and, in particular the default conversions of the various data types into either COM or just unmanaged C++. The String object maps to several character array types and sometimes you have to use the MarshalAs attribute to make the operation happen smoothly.
|
|
|
|
|
No. I want to use a static library. To use it, I need a dynamically allocated char buffer. new and malloc raise exceptions. Thats the problem.
IJW seems to fail already. Thats why I will be porting the library completly to .net.
Thanks,
Eric
|
|
|
|
|
Actually, my problem is: I have 2 COM libraries, implemented as set of Dispatch objects for automation and set of Custom objects for C++ usage. And I'd like to write my own DLL based on on of those sets. The main question is: what language should I use??? I tryed C# with Dispatch objects set and found it rather slow. So, maybe I can use C# and set of custom interfaces, or shall I switch to C++.NET???
Vad
|
|
|
|
|
|
Hi,
I've a problem with the syntax of function pointers in C++ on Linux (GNU g++, RedHat). I can do all combinations except the one in the small example below. To explain what I want to do:
I want to port an application from Windows to Linux. I own a class A which stores data of any structure. Class A does not know anything about the structure of a data-record so it offers some function pointers where another program or class can connect a method to sort, print .. etc records of data. This methods are then called by Class A when adding, printing, storing etc.. data, which works fine on Windows with Borlands C-Builder using the __closure keyword when defining the Function Pointer. My Application-Class (Lets name it Class B) uses Class A to store polygons and also provides the needed methods for comparing etc, but the compiler complains about lines like ClassA->DoCompare = &ClassB::MyCompare using g++ on Linux.
Here is an example stripped down to the problem, myclass1->init() stores a pointer to its printing-method myclass->print1 to the function pointer of myclass2 (myprint), then myclass1->execprint is called by main. myclass1->execprint then calls myclass2->doprint which - using the function pointer - calls myclass1->print1.
#include <stdio.h>
class myclass2
{
public:
void (myclass2::*myprint)(char*);
void doprint(char* text)
{
(this->*myprint)(text);
}
};
class myclass1
{
public:
myclass2 *c2;
void init(void)
{
c2 = new myclass2;
c2->myprint = &myclass1::print1;
}
void execprint(char* text)
{
c2->doprint(text);
}
void print1(char* text)
{
printf("PRINT: %s\n", text);
}
};
main()
{
myclass1 *c1;
c1 = new myclass1;
c1->init();
c1->execprint("EXEC");
delete(c1);
}
The error Message of the compiler is:
<br />
class2.cpp: In member function `void myclass1::init()': <br />
class2.cpp:23: cannot convert `void (myclass1::*)(char*)' to `void <br />
(myclass2::*)(char*)' in assignment <br />
Funny, but when everything happens in one class, it works and the compiler is happy; But this is not the solution for my problem because I cannot merge the two classes:
#include <stdio.h>
class myclass2
{
public:
void (myclass2::*myprint)(char*);
void doprint(char* text)
{
(this->*myprint)(text);
}
void init(void)
{
myprint = &myclass2::print1;
}
void execprint(char* text)
{
doprint(text);
}
void print1(char* text)
{
printf("PRINT: %s\n", text);
}
};
main()
{
myclass2 *c1;
c1 = new myclass2;
c1->init();
c1->execprint("EXEC");
delete(c1);
}
Does someone have an idea how to solve this - and if there is no solution, how would you solve the problem when a class needs to call a function which is not known at development-time? (qsort() is a good example, here you need to deliver a comparing function, but qsort is not included in a class so its no problem);
Thanks in advance
Armini
|
|
|
|
|
Hello. I would like to get only the Date of a DateTimePicker control.
I know I can use:
DateTimePicker DTP;
String* Date = DTP->Value.get_Date().ToString();
My problem is that the Time is set to '00:00:00' and I don't want it inside my string.
What is the best why to get only the date out of a DateTimePicker control?
Thanks.
|
|
|
|
|
dateTimePicker1.Value.ToShortTimeString();
|
|
|
|
|
I'm trying to use two functions to print to the screen a letter from the alphabet or my name using asterisk * characters. Does anyone know how to do it?
none
|
|
|
|
|
This is the Managed C++ forum.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Hi,
I am new to C++ programming. I am using the following code to check if a file exists, if not then create a new file and input something into the file.
the code runs well for the first time and creates the file as desired, however if the file created is manually deleted from the specified directory then the file is no longer created. I don't why ????????
Appreciate any help in this regard
ifstream dbfile("/var/puremail/tmp/pm_db_down.txt");
if (!dbfile.is_open()) {
cout << "The file does not exist. Creating a new file" << endl;
ofstream dbfile ("/var/puremail/tmp/pm_db_down.txt");
dbfile << puremail.m_getTime << endl;
dbfile.close();
exit(2);
}
else {
// read the file and calculate the time for which the db is down
}
when this code is run for the first time the file was created and also the time was written into the file, however after deleting the dbfile if I again run the code, the file is no more created.
Appreciate any help in this regard.
Thanks,
Mohit.
|
|
|
|
|
Wrong forum.
In Managed .NET C++, you would do things entirely differently.
But, your code example is not that complicated. You don't indicate how the file was created in the first place. It could be pre-existing, created by another application, or any one of a number of different methods.
|
|
|
|
|
how to import jpg format file in c++
any ides,if yes will be highly appreciated
|
|
|
|
|
It's even easier than in Visual C++ version 6.
I assume you want to display this image (on a Form).
First create a Graphics object, using the new operator.
Then call DrawImage->FromFile (this function has numerous overloaded forms an will accept a .jpg format image file).
Then, if the application compiles, your .jpg file must reside in ther same directory as the executable.
You can read all about these techniques either in your Microsoft Visual C++ .NET documentation. or, go over to the MSDN site and search.
|
|
|
|
|
how to revolve a circle in graphics also a line too.getting real problem!please kindly help me!
|
|
|
|
|
Do you want to animate a Form display?
Or what?
|
|
|
|
|
thank u for the replies i want to animate and make me much ckear about the importing .jpgs is graphics
|
|
|
|
|
|
hi... im having errors in managed c++(its the c++ in vs.net right?)..
c:\Documents and Settings\pc\Desktop\link41b\src\error.c(30): error C2051: case expression not constant
c:\Documents and Settings\pc\Desktop\link41b\src\error.c(30): error C2065: 'NODICT' : undeclared identifier
i hope you can help me with this.. thanks guys
|
|
|
|
|
Look at line 30 in error.c file; it's probably a typographical error.
If not, post the code segment.
|
|
|
|
|
I coded a bubble sort (below) and it works when I run it through Visual C++ but when I open it manually in XP the window opens and lets the user enter data and it quits quickly afterwards without displaying the output.
#include <iostream>
#include <iomanip>
using namespace std;
//Macro for max size of array
#define MAX 50
int Array[MAX];
int main()
{
cout << "\n----------------BINARY SORT ALGORITHM-------------------\n" << endl;
//Code for entering data into array
cout << "Enter up to " << MAX << " integers. " << "(Quit with any letter):\n" << endl;
for(int i = 0; i < MAX && cin >> Array[i]; ++i)
;
int ArraySize = i;
//Display Array
cout << "\nArray Size:- " << ArraySize << "\n" << "\nArray:- ";
for(int ii = 0; ii < ArraySize; ii++)
{
cout << setw(5) << Array[ii];
}
cout << "\n\n";
//Flag to show if sorted or not
bool Sorted = false;
//Temporary store whilt swapping
int Swap;
while( !Sorted )
{
Sorted = true;
for(int iii = 0; iii < ArraySize; ++iii)
{
if( Array[iii] > Array[iii + 1])
{
//Prints out current state of array
for(int j = 0; j < ArraySize + 1; j++)
cout << setw(5) << Array[j];
//Swapping code
Swap = Array[iii];
Array[iii] = Array[iii + 1];
Array[iii + 1] = Swap;
cout << "\n";
//Flag false since swapping occured
Sorted = false;
}
}
}
//Output
cout << "\n\n" << "SORTED LIST\n";
//Counter in the loop and condition are adjusted to ignore first element which is always 0 and to include last element
for(int iiii = 1; iiii < ArraySize + 1; iiii++)
cout << setw(5) << Array[iiii];
cout << "\n\n" << endl;
return 0;
}
Thanks
|
|
|
|