|
João Paulo Figueira wrote:
I just wonder how ADO does its RecordCount processing. Most likely, it will scan all rows as I am doing.
Most likely! ADO is pretty brain dead actually...
--
Ich, du, sie, er, es, ihr, sie, Sie.
|
|
|
|
|
I just found the answer I needed, although it is provider-dependent. SQL Server CE 2.0 exposes a IRowsetPosition interface that will return a count of the number of rows in the rowset (as well as the current position of the cursor).
Regards,
João Paulo
|
|
|
|
|
Ah, ok. SQL Server CE 2.0 can't handle very big amounts of data? There has to be some fixed reasonable limit for which the DBMS can make assumptions about.
--
N = { ni | n0 = 0, ni + 1 = ni + 1, i ³ 0 }
|
|
|
|
|
The DB size limit is 2GB (as well as max table size). Anyway, using this interface is straightforward and does not seem to reduce access speed.
Regards,
João Paulo
|
|
|
|
|
Hello
Does anyone know a way to place a Crystal Report Viewer in the Visual C++ project?
I can't do it But didn't find a statement that it is impossible in the help system.
Thank you in advance
|
|
|
|
|
If you're using managed C++, VS.NET 2003 now has visual Windows Forms designer. Drop it on the form like any other control. If you have VS.NET 2002 and still using managed C++, you can code the control manually. Just instantiate it, set the size and location, and add it to the form's Controls collection.
If you're not using managed code but trying to use the Crystal Report Viewer that comes with VS.NET - it won't work. That's only a managed control. In this case, you'll have to buy Crystal Reports from www.crystaldecisions.com.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
look at craxdrt.dll (I'm assuming you're talking about the ActiveX control). You can instantiate the control as any other AX control and use it.
If I remember correctly, there are samples on how to do this in some samples subdirectory of the Crystal Reports installation.
--
Ich, du, sie, er, es, ihr, sie, Sie.
|
|
|
|
|
Hi,
I would like to make a client/server App using C++ and visual studio.net that run on winXP.
I know that I can use CAsyncSocket and CSocket to create such an App. But I would like to know if it's the best way to do it? Is there other utilities that I can use?
Thanks for helping
Myke
Everything's beautiful if you look at it long enough...
|
|
|
|
|
I highly recommend raw winsock.
Kuphryn
|
|
|
|
|
Good day.
I've got little problem - I need to insert metafile with picture in it in to rich edit. I must do it without COM. MFC/Win API only. Does anyone knows, how to do that? Advice or piece of program would be a great help.
Trapper
|
|
|
|
|
Hi Everyone,
First time poster on this site, I hope someone can help me with this problem.
Let say my program is install in C:\myprog and everytime before it exits, it writes a string to a file. It works ok because I logged in as an Admin. But, if a user logs in and doesn't have write permission, then the program cannot save data to the file in that directory when it exits. Is it possible for my program to write to the directory, even though, the user does not have the access rights? If so, how can I programmatically do it using Win32 API? Any helpful suggestions or hints would be appreciated.
It runs on WinNT with NTFS.
Thanks,
ing
|
|
|
|
|
There are two approaches; one, give users TCB privilege (ugh!!) so they can run the app and it can impersonate a user who has access, Not a good idea, or second, have a service running with no GUI which runs as a user who has access, and have your app talk the the service. It has permission, so it can write, user doesn't need permission.
You'd need to use something like TCP/IP or Named Pipe for communication, I guess.
Steve S
|
|
|
|
|
Any problems with that in VS 2003? Some of my colleages have hinted I might have to recompile the dlls to get VS2003 compatible libs? Sounds odd to me. If so.. what has changed and why?
|
|
|
|
|
how do you get the 3d inner border style of of the CMainFrame window to disappear?
I don't want my child view to look sunken into the frame. I tried &= ~WS_ with several styles on OnCreate, but nothing has worked so far.
tried all the
lpCreateStruct->dwExStyle &= ~WS_
plus I tried the
lpCreateStruct->style &= ~WS_
|
|
|
|
|
|
|
Hi, I need to get list of databases on server thru ODBC.
I can do it by native query for specific database server,
but I need to do that by ODBC function, to work on any server.
I can get list of tables thru SQLTables function, but how can
I get a list of databases?
Is there a way to do that?
|
|
|
|
|
Below is a code snippet that will help demonstrate how to get the list of catalogs for a given DSN and load them into a combo box:
CComboBox *pCB = (CComboBox *)GetDlgItem(IDC_CODEGENTBL_DB);
pCB->ResetContent();
DBConnection *pDBConn = &(((CodeGenOpts *)GetParent())->m_oDBConn);
DBStatement oStmt(pDBConn);
oStmt.AllocStatement();
int iDBCount = 0;
CString cDBName;
SQLRETURN iResult = SQLTables(oStmt.GetStmtHdl(),
(unsigned char *)"%", 1,
(unsigned char *)"",0,
(unsigned char *)"",0,
(unsigned char *)"",0);
if (iResult == SQL_SUCCESS || iResult == SQL_SUCCESS_WITH_INFO)
{
while (oStmt.FetchNext())
{
cDBName = oStmt.GetString(1);
if (!cDBName.IsEmpty())
{
pCB->AddString(cDBName);
iDBCount++;
}
}
oStmt.EndSQL();
}
onwards and upwards...
|
|
|
|
|
Hi,
I have a class that is exported by using dllexport. Now, I wish to use the methods of the class. If I use dllimport, I have to include the .h files and add all the .lib files to start using the methods of the exported class. Now, can I achieve the same using Loadlibrary()? If yes, how can I do it and is it a better option to use Loadlibrary()? Any problems that you foresee with this? Please suggest.
thanks.
|
|
|
|
|
Radha Nair wrote:
If yes, how can I do it and is it a better option to use Loadlibrary()?
I have not seen any examples of doing this with C++ classes. So I'm thinking that no you can't do it. I'm sure someone will try to proove me wrong, though In the case of the first method of including the .h and .lib files, the compiler and linker will be doing 'things' that won't get done when you use the second method. You can probably get the second method to work, if you know all the 'things' the compiler and linker do for you and then emulate that some how in code that you incorporate with your LoadLibrary calls. Can it be done, maybe, but I haven't seen an example so I don't think it can.
One option is to write some plain 'C' functions that provide an interface to the C++ class, and use these instead of the C++ methods.
Chris Meech
"what makes CP different is the people and sense of community, things people will only discover if they join up and join in." Christian Graus Nov 14, 2002.
Oh and for those that ask programming questions in the lounge. Seek the truth here[^].
|
|
|
|
|
Chris Meech wrote:
I'm sure someone will try to proove me wrong, though
Not trying to prove anything. But maybe something like this can be done?
class ExportedClass
{
public:
ExportedClass();
~ExportedClass
void Abc();
};
ExportedClass* GetExportedClass()
{
return new ExportedClass();
}
Now in the main exe, do something like :-
GETEXPORTEDCLASS func = GetProcAddress(...,"GetExportedClass");
ExportedClass* pec = (func)();
pec->Abc();
This is untested code and it might not work for various reasons (member name mangling for one) but it's worth a try. If this is a stupid idea, please forgive my relative ignorance in such matters
Nish
Extending MFC Applications with the .NET Framework [NW] (My book with Tom)
Summer Love and Some more Cricket [NW] (My first novel)
Shog's review of SLASMC [NW]
Come with me if you want to live
|
|
|
|
|
Thanks, Nish. That's what I was sugggesting as an alternative. Except that I think you also have to have an exported function to access the Abc() function. In your example the Abc method wont be exported. And not to mention that there are a whole lot of issues with new/delete, memory leaks, name mangling and such. It can get quite ugly, to say the least.
Another option to consider as well, is to use COM to 'export' the class. But that's for another day.
Chris Meech
"what makes CP different is the people and sense of community, things people will only discover if they join up and join in." Christian Graus Nov 14, 2002.
Oh and for those that ask programming questions in the lounge. Seek the truth here[^].
|
|
|
|
|
Really appreciate all the help. thanks both you guys.
Nishant, I understood your method. It's real clean. But the problem is that Iam not developing the exported class. It has already been developed and closed. They have just used dllexport to export it. So, considering the situation, do I have any choice other than going for implicit linking?
Any other method of explicit linking without touching the header/cpp file of the class that is being exported?
Sorry if Iam asking for too much!
|
|
|
|
|
DelayLoad...
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
The trouble with using LoadLibrary with classes is the name mangling done by the compiler/linker make it very difficult to access members of the class. I believe that it is generally easier to use the implicit linking method for classes.
An alternative (and one I have used) is to make a layer of C functions to access the class. You can write an initialize function to construct, a terminate function to destroy, and then pass in a pointer to the object to functions that access the methods of the object. This takes a little work but is easy to implement.
The Ten Commandments For C Programmers
|
|
|
|