|
Terry,
Thanks, very useful information for me.
Opps I did confuse the issue a little with the double slashes but thanks for seeing through to my real question.
Steve
|
|
|
|
|
Hi,
Is it at all possible to create several executables in the same project? I'm using Visual C++ .NET 2002.
I would like to be able to quickly create small test programs using the classes I develop for my main program in the project. So I would just like to be able to add a small testfile containing just a simple console prog and do some simple tests.
Please forgive me if this is a stupid question, but I have only recently started using VS and I have searched the documentation without finding the answer.
thanks
Luddet
|
|
|
|
|
In your solution
File - Add Project - New Project / Existing Project.
(Solution can contain many projects, the term has changed)
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Thanks, but I know that one solution can contain many projects. That's not what I'm after.
I need to know if it's possible to have several files with a main() or WinMain() in each, and have each one of them generate an executable. And I want to have them in the same project.
I know I can setup another project and "Add existing..." and selecting files from another project. But I don't like to litter my workspace with too many projects with the accompanying directories in my solution directory.
|
|
|
|
|
I think you are talking about MAKE file. You can configure the MAKE file to do the thing that you want. However, i am not familiar with it.
Another option if you do not want to edit your MAKE is you configure your IDE to do batch build.
Hope this helps.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Hmmm... that sounds kind of involved too...
But I'll have a look at it anyway.
Thanks
/luddet
|
|
|
|
|
luddet wrote:
I need to know if it's possible to have several files with a main() or WinMain() in each, and have each one of them generate an executable. And I want to have them in the same project.
No. A project produces only one executable unless you mess with make files or custom builds to rig it to make more than one executable.
Use multiple projects and do batch builds. I do this all the time. For vc6 I have an addin that I run msvc from the command line and it will build all projects in the workspace.
John
|
|
|
|
|
well, batch builds is a piece of cake in .net, just SHIFT+CTRL+B.
I guess I'll just have to setup an extra test project for each regular project then
thanks for your help guys
/luddet
|
|
|
|
|
Hi,
I want to access and show a few html files and jpg files. I am thinking about making a resource only dll containing the html and jpg files. But I have never made one and I have few questions, Please reply.
1. My SDI project and Resource Only DLL should be two separate project, or I can include a resource only dll in my SDI application?
2. How do I access the resources in the dll from my application?
3. If SDI application and the dll are 2 separate project how are they loaded together, so that if I port my exe to a different machine it would work?
4. .jpg files are what kind of resources? because I just see ico and bitmap resources in the resource import dialog.
Please advise soon
Thanks
|
|
|
|
|
1. YOu need to have 2 seperate workspace one for your sdi
application and other for ur resource only dll.
2. The projects will be definitely be 2 but you can insert the resource only project into ur sdi project workspace so that you can work on both simultaneously.
3. You need to supply both the modules when installing in other machines and also other dlls that ur modules are depending upon ( you can get the list by using depends.exe supplied with visual studio.
4..jpg will be inserted as custom resource loading and using custom resource is a different topic, (that i dont know much about)
hope i answered ur quries.
My God is more powerfull Than Your God. (the line that divides the world)
|
|
|
|
|
Hi everyone,
I have a small set of classes that use MFC's CDatabase class to communicate with SQL server. I need to convert my classes to an ATL control because I need to use it in a C# SOAP Web service.
The CDatabase performance is not very good, in my opinion. Anyways, I was thinking of taking this opportunity to optimize my code as well. So, I was wondering what would be the best database library to use in your opinion. I am developing under VC++ 6.0. No scope for any .NET stuff with this one.
Looking forward to hearing from you fine folks.
Sincerely,
Pankaj
Without struggle, there is no progress
|
|
|
|
|
|
what is the command for getting a pointer to the document class from a dialog class. Sorry if this is a basic question, but I don't seem to know how to get variables from the doc class from my document class
Q-Bus
|
|
|
|
|
Add a member variable for your dialog class to store the pointer to the document.
After instantiating but before calling your dialog, assign the pointer for your document class to this new member variable.
|
|
|
|
|
Create the dialog box in Document class.
if var1 and var2 are 2 variables of document class to be used by dialog class.
if var3 and var4 are variables of dialog box class.
CMyDoc::MyFunc()
{
CMyDialog Mydlg;
Mydlg.var3 = var1;
Mydlg.var4 = var2;
if(Mydlg.DoModal()= IDOK)
{
var1 = Mydlg.var3;
var2 = Mydlg.var4;
}
}
never say die
|
|
|
|
|
I've a table in an Access database with an AutoNumber field. When I add a row to the table through a CRecordset object, I want to know the value of the AutoNumber field. I've read various articles on how this is done, but none of them work. The code basically looks like:
CMyRecordset set;
CDBVariant bookmark;
set.Open(AFX_DB_USE_DEFAULT_TYPE, NULL, CRecordset::useBookmarks);
set.AddNew();
set.field1 = 123;
set.field2 = 456;
...
set.GetBookmark(bookmark);
not been updated
set.Update();
the current one
set.Requery();
set.SetBookmark(bookmark); I successfully use bookmarks in other areas of the program when editing rows. I populate a listbox with each record in a recordset and assign the AutoNumber field using SetItemData() . When an item in the listbox is selected and the Edit button is clicked, I have the correct bookmark and can then use SetBookmark() and Edit() successfully. Using this scenario, if a newly added listbox item does not have a correct bookmark associated with it, SetBookmark() cannot be used prior to Edit() or Delete() calls. In other words, I have no way to navigate to the desired record.
Any ideas for this long-winded request?
Thanks,
DC
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
In theory - you need to obtain an exclusive lock to your datasource (I don't know how to do this because depending on ODBC drivers/ADO vrs DAO/etc. it changes). Then do the insert. Then query for MAX on the ID column. This will give you access to the newly inserted record. Then unlock it.
|
|
|
|
|
Terry O`Nolley wrote:
In theory - you need to obtain an exclusive lock to your datasource...
I'll try this, but I'm not following your logic. What would an exclusive lock on a single-user database have to with being able to query an AutoNumber field of a newly-added record?
I guess my main concern is that the dozen or so examples I looked at on MSDN and the Internet all showed basically the same approach: after an Update() , get the bookmark, call Requery() , set the bookmark, get the AutoNumber field value. The problem seems to be that after the call to Update() , the recordset is positioned back at the first record.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
DavidCrow wrote:
I'll try this, but I'm not following your logic. What would an exclusive lock on a single-user database have to with being able to query an AutoNumber field of a newly-added record?
I didn't realize it was a single-user DB.
If it is a single user DB then you don't need the lock. Just do the insert and query for MAX ID.
If your ID field is an auto-number, then the MAX will be the newly inserted record.
Using LOCK prevents other records from being inserted while you do your insert.
|
|
|
|
|
after update you are requerying and setting the bookmark. this is wrong.
you can get bookmark of a current record after you update. and bookmarks are valid only for navigating in the current recordsets. once you close and reopen or requery then the bookmarks get vanished. you should call recordset.canbookmark() to check whether it is possible to bookmark or not. use CDatabase::GetBookmarkPersistence.
always use exception handling in database programming to get the actual cause of erro.
never say die
|
|
|
|
|
sam India wrote:
after update you are requerying and setting the bookmark. this is wrong.
Please explain.
sam India wrote:
you can get bookmark of a current record after you update.
Which is what I am doing.
sam India wrote:
and bookmarks are valid only for navigating in the current recordsets. once you close and reopen or requery then the bookmarks get vanished. you should call recordset.canbookmark() to check whether it is possible to bookmark or not. use CDatabase::GetBookmarkPersistence.
As I already indicated, bookmarks are used elsewhere so CanBookmark() was omitted from the code snippet. I have used CheckBookmarkPersistence() to verify that bookmarks support the SQL_BP_SCROLL , SQL_BP_UPDATE , and SQL_BP_DELETE operations.
sam India wrote:
always use exception handling in database programming to get the actual cause of erro.
Exception handling is in place. I omitted it from the code snippet for brevity.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
program for trnslation code from owl to mfc
|
|
|
|
|
|
Does Object Windows Library still exist?
|
|
|
|
|
I think Borland have migrated it to VCL
Sonork 100.41263:Anthony_Yio
|
|
|
|