|
Hi,
There is a problem, in executing a SQL query. After executing SQL query i want the result in an Object. My SQL query is something like this
SELECT TOP 1 '1234' AS Code, '211' AS Operation, 2 AS Source, 89 AS Destination, FROM xyz where xyzno = 10
How can i executing this SQL query and find the result of this query in an object. I am using VC++6.0 and my database server is Microsoft SQL .
if there is some code sample then its better.plz help me!!!!!!!!!!
Thanks for all
Regards
Rajan
|
|
|
|
|
Maybe you can use CDatabase and CRecordset ? I know you can use SQL instructions while opening a CRecordset that will then contains all the selected records. Take a look at CRecordset::Open
|
|
|
|
|
I have had good results using this project here:
http://www.codeproject.com/database/caaadoclass1.asp
They are very fast too.
|
|
|
|
|
I want to use WinCVS as my version control tool in the visual Studio 2003 .net.
I do not want to use it in an integrated manner (Jalindi Igloo is often suggested but do not want to use this). I will run WinCVS as a separate program and check-in and out as required.
What I want to know is which files will I have to import to allow me to reproduce a project? Some of the extensions taht may be cause for concern is *.resources, *.pdb, *.projdata, *.suo ... there is s along list but what to a really need?
What I want to know is what i need to put int the .cvsignore file?
Thanks,
Liam
|
|
|
|
|
Add only to your repository files that you can't recreate. To check, do a 'clean solution' before you start adding files. For more information on what each file extension signifies check msdn. If you are unsure whether a file type is binary, try opening it in a text editor - however wincvs is pretty smart and most of the time it will autodetect the correct settings.
As a starting point, you should consider adding the following types as text:
*.sln
*.vcproj
*.cpp
*.cxx
*.c
*.h
*.hpp
*.hxx
*.rc
*.rc2
And the following types as binaries:
*.ico
*.bmp (and other image types)
You can safely ignore:
*.obj
*.exe
*.dll
*.lib
*.pch
*.ncb
*.suo
*.idb
*.pdb
*.bsc
*.ilk
|
|
|
|
|
Andrew,
Thanks for the reply - that is very useful.
I tried to to a clean but I could not find the menu option.
Building in the Development Environment according to the help page I should be able to:-
To clean the active project
On the Build menu, choose Clean.
But I don't have a Clean option. Any suggestions?
By the way I am using Visual Studio 2003 .net
Thanks
|
|
|
|
|
LiamD wrote:
I don't have a Clean option. Any suggestions?
'Clean Solution' is the third item in the build menu in a default install of Visual Studio 2003. If it isn't in the right place try customising your menus / toolbars
|
|
|
|
|
Hi,
Can anyone ols help me how to execute a Java executable/code from C++?
Is it possible pls help
Thanks in Advance
Ram
|
|
|
|
|
cberam wrote:
Can anyone ols help me how to execute a Java executable/code from C++?
Is it possible pls help
Do you mean launch a Java program from C++ or call Java functions from C++?
For the first see: java+exe[^]
Directly calling Java functions from C++ is done with JNI[^]. This is an extremely clumsy, ugly, and almost unusable interface. Better start a Java program and call C++ functions (in a DLL) from the Java program. This is comparatively simple.
|
|
|
|
|
Hi,
Is there any size limit on an executable created? My Loader application creates an executable which hosts certain data files. But the exe (having 2 GB size) fails to execute , while it was successful to execute exe having 1.5GB size. I use Win2k professional with 256MB RAM.
Waiting for your valuable comments
Thanks,
Vini
|
|
|
|
|
I don't have any definite knowlege on this - but it stands to reason that windows would not like this at all. I think you may just have to bite the bullet, and turn it into a loader and "companion file". If this is an installer we're talking about, and you absolutly must have one file, you could try producing an MSI file instead of a self extracting installer.
Joel Holdsworth
Wanna give me a job this summer?
Check out my online CV and project history[^]
|
|
|
|
|
The system, on a regular x86 installation of Windows, will be unable to load an image that large because it will run out of virtual address space in the process.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
|
Maximilien wrote:
you mean your exe file is 2gig ?
I think he's saying his single-image setup.exe is > 2 gig...
~Nitron.
ññòòïðïðB A start
|
|
|
|
|
Hello,
If the exact size of the executable is more than 2GB the problem can be that windows has not enough adress space left to create a heap and / or a stack. I don't know if the linker will complain about having not enough adress space left...
But honestly, what were you thinking when you made that 1.5GB jumbo executable 500MB bigger? Like other people mentioned, you should try and put some of those MB's in a separate file.
I also got the blogging virus..[^]
|
|
|
|
|
Thanks for the comments.
My executable contains data to create a DVD movie. Its something like packing all data inside the executable and on execution it creates a DVD movie with the data it hosts. Its not a setup exe. I cannot put the data in seperate files. It has to be one single executable.
When the exe was 2 GB, it didn't issue any sys warning or error message, but a application error saying the header could not be read. I think the Loader didnot create the executable fully/properly. But with 1.5 GB data, it worked fine.
Vini
|
|
|
|
|
2GB executable file.
You must be kidding ...
Rahim Rattani
Software Engineer,
Matrix Systems (Pvt) Ltd.,
Karachi - Pakistan
|
|
|
|
|
Rahim Rattani wrote:
You must be kidding ...
No I am not.
Vini
|
|
|
|
|
Hi,
I have an application (in VC++ 6.0) wherein it displays the images in ListView. So the application starts displaying the images from the Top left corner (0,0).
Now I have added the manifest file (to give XP look to application) in applicatoin resource successfully. (as outlined in the below mentioned link http://www.codeguru.com/Cpp/controls/controls/article.php/c5227/[^])
The application is having the XP look but the images are displayed from the Bottom left corner.
Question:How to set the origin of the ListCtrl to top left corner (0,0) so that the images are displayed from the top left corner (0,0) ?
Thanks & Regards,
Neeraj
|
|
|
|
|
Hi,
Is there any C++ CLASS/API similar to JAVA "HttpURLConnection" .
Pls help
Thnaks
Ram
|
|
|
|
|
|
Hi,
I have a ActiveX component (3th party) in my own MFC project (Dialog, shared). If i run the project in developers studio i see some logging comming from the ActiveX component.
Now i want to write this logging to a file, without using developers studio. Somehow i don't get it to work. I tried to reroute the stdout/stderr stream, also the _CrtSetReportHook2 catches a lot...but not the activex logging.
Has anybody a idea how to get it done?
Many thanx,
Richard
|
|
|
|
|
Hi everyone!
My name's Duc , I'm from Vienam and I'm a student . I've just used
MFC(VC6.0).I think memory allocation is very important in programming,isn't it? I've tried to search in MSDN but it's not clear!So I want to ask you some question in my situation :
I have a class T which has a default destructor does nothing . T also
has a member variable : char *str; and a constructor :
T::T()
{
str=new char[200];
}
I allocate an object of class T in function f() by the new
operator like this :
void f()
{
T* pT=new T();
}
The question is : Will the memmory block(contains 200 bytes of str)
which is pointed to by pT be free(deallocated) when we leave the function
f()?What happens inside (when deallocating)?
Thank you for your listening and help!
Ky
|
|
|
|
|
HoDuc wrote:
I think memory allocation is very important in programming,isn't it
Yes, you can quickly go into real troubles
Ok, in your case, the memory allocated for your string won't be freed in your program. You need to free it in the destructor of your class:
T::~T()<br />
{<br />
if(str)<br />
{<br />
delete[] str;<br />
str = NULL;<br />
}<br />
}
[EDIT] Ok, I read your post a little bit to fast. One think that is really really important is that each new must have a corresponding delete to free the memory allocated by new. In your case, if you create a new object in your function, it won't be deleted automatically when leaving the function so you will first need to delete it. When deleting an object, this will automatically call the destructor of your class. And inside this destructor, you will free the memory allocated for your string. Easy, isn't it ? [\EDIT]
|
|
|
|
|
Ok, I will go a little bit deeper in details. It's true that it is a part that is not easy to understand at the begining.
The destructor of a class is there to free the memory that has been dynamically allocated (so with a new) for one or several member variables of your class (could do other things also but here we will just speak about the memory management). This is typically the place where you need to put the delete of str in your example. Even if the variable has not been allocated in the constructor for example !!
A good way of working is that if you don't allocate memory in the constructor for a pointer of your class, make it NULL:
T::T()<br />
{<br />
str = NULL;<br />
}
Thus, when you destructor will be called, you can check if this memory has been allocated or not and free it in the first case:
T::~T()<br />
{<br />
if(str)<br />
{<br />
delete[] str;<br />
str = NULL;<br />
}<br />
}
So, now when is the destructor of a class called ? Simple: whenever the object is being destroyed. By destroyed I mean not only when calling delete but also when your object (not allocated by new) goes out of scope. Example:
int foo()<br />
{<br />
T Object;<br />
....<br />
....<br />
return 0;<br />
}
In this case, your object has not been allocated dynamically but its destructor is called when the object is destroyed (leaving the function).
I hope this is a little bit clearer ? If you have further questions, do ask
|
|
|
|