|
Hi ,
Whlie we have hot technology (the COM's, D-COM's etc etc) I am often need to simply take a MS-Excel spreadsheet and 'import' data to my application.
There are a few articles on this, but in each it seems either Very 'complicated' eg setup odbc, or has limitations like having to hard-code the number of columns or having to name a range.
What I really need is a class that .OpenXLS file and then you can .GetAt(Sheet,row,col) .SetAt(Sheet,row,col)
Regards
|
|
|
|
|
There's an article on working with excel com objects in the April 2000 edition of C/C++ Users Journal - looks like there are workbook and worksheet interfaces that would do what you need and more.
|
|
|
|
|
Hi -
How can I enumerate the internet explorer history items?
Windows explorer seems to manage...?
I enumerated all the objects in the shell namespace, but where the history should be, I get :
e0000077:[5] History
e0000077:[6] History.IE5
40400177:[7] index.dat
40400177:[7] desktop.ini
70400177:[7] MSHist012000052220000529
40400177:[8] index.dat
70400177:[7] MSHist012000052920000605
40400177:[8] index.dat
70400177:[7] MSHist012000060520000606
40400177:[8] index.dat
70400177:[7] MSHist012000060620000607
40400177:[8] index.dat
70400177:[7] MSHist012000060720000608
40400177:[8] index.dat
70400177:[7] MSHist012000060820000609
40400177:[8] index.dat
70400177:[7] MSHist012000060920000610
40400177:[8] index.dat
70400177:[7] MSHist012000061020000611
40400177:[8] index.dat
70400177:[7] MSHist012000061120000612
40400177:[8] index.dat
40400177:[6] desktop.ini
Cheers,
Charlie.
|
|
|
|
|
Look up FindFirstUrlCacheEntry() and the related functions. Here's some code for a console app that prints all history item to stdout. The history view you see in Explorer is generated by a namespace extension.
#define WIN32_LEAN_AND_MEAN
#include <afxwin.h>
#include <tchar.h>
#include <wininet.h>
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
HANDLE hFind;
BYTE byBuffer[16384];
INTERNET_CACHE_ENTRY_INFO* pInfo = (INTERNET_CACHE_ENTRY_INFO*) &byBuffer[0];
DWORD dwSize = sizeof(byBuffer);
pInfo->dwStructSize = sizeof(INTERNET_CACHE_ENTRY_INFO);
hFind = FindFirstUrlCacheEntry ( _T("visited:"), pInfo, &dwSize );
if ( NULL != hFind )
{
do
{
cout << "lpstrSourceUrlName = " << pInfo->lpszSourceUrlName << endl
<< "Times visited = " << pInfo->dwHitRate << endl
<< "Last time visited = ";
CTime t ( pInfo->LastAccessTime );
cout << (LPCTSTR) t.Format( "%b %d, %Y at %H:%M:%S" ) << endl << endl;
dwSize = sizeof(byBuffer);
} while ( FindNextUrlCacheEntry ( hFind, pInfo, &dwSize ));
FindCloseUrlCache ( hFind );
}
return 0;
}
|
|
|
|
|
There is an artical on this site (OCX Snapshot) that shows you how to make an ActiceX
control capture it's image to a JPEG file, so it can be displayed in a Website.
This method could be improved by making the control write to a metafile and then convert
the metafile to SVG. SVG is an improvement over JPEG as it's smaller and scalable and an
internationally recognised format. I think there is already source code available on the Web
which converts a metafile to SVG.
|
|
|
|
|
Does anyone has a successfuly implemented MFC application using a design pattern uder then the doc-view model they can share?
I'm looking for design pattern implementations like MVC (model-view-controler) that have been used in real applications.
I known I can used Stingray's toolkit for that but I don't really like their solution much... and I don't want to depend on a 3rd party developer toolkit...
Thanks to anyone who can help!
|
|
|
|
|
It is well known that the common functions clrscr() and gotoxy() are not supported in Visual C++. But I presume that calling directly to DOS interruptions using in-line assembler would provide a convenient way of making this functions. Since I don't know Assembler programming, does anybody have these two function already made?
|
|
|
|
|
I think you'll bugcheck on 98 with an _asm int 21;
Here's some code that might help:
The clrscr can be had with
system("cls");
The more powerful way us to get a handle to the
console and use the console api calls.
The MS Knowledge base has a good article on
clearing the screen - Q99261 - first, you
need a handle though...
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_SCREEN_BUFFER_INFO csbi;
GetConsoleScreenBufferInfo(hConsole, &csbi);
COORD coord;
coord.X = 0;
coord.Y = 0;
SetConsoleCursorPosition(hConsole, coord);
That should move the cursor to the top of the screen without clearing it. See Q99261 for the clear screen.
|
|
|
|
|
I would like to find a tutorial that teaches how to convert those many CWnd-derived Control Classes found in this website into ActiveX controls.
|
|
|
|
|
Does anyone here have an idea of how to do access database synchronization using only code (CDaoDatabase?)
|
|
|
|
|
Is there a way to define a makro like this:
#define NEW_VAR CString str__Line__
The compiler should make
out of:
void CMyClass::Test()
{
NEW_VAR
NEW_VAR
}
something like :
void CMyClass::Test()
{
CString str123
CString str124
}
out of it.
I dont care about the Lines.
I just want to define a marko witch declares a Variable. And I want to use it more then 1 time in a function.
Thank you...
|
|
|
|
|
Even if it could, how would you access the variables? By name? I don't believe, since you don't know their names.
This would be just good for objects like CWaitCursor or so, which has just a constructor and a destructor. But those objects, you don't need more than one per scope, do you?
So what should this be good for?
|
|
|
|
|
OK...I try to explain it:
We got an ErrorClass (EFErr).
We need our ErrorClass in nearly every function.
Usually we use it like that:
EFErr CTest::Tester(...)
{
EFErr oErr=Hallo(...); //Funktion Hallo returns a EFErr too
if (oErr) //Check if a error accours
{
return oErr; //return this error
}
}
I want to reduce the code with an Makro:
#define RET_FUNKTION(function) EFErr oErr=function;if (oErr){return oErr};
so I can do the same like above with:
RET_FUNKTION(Hallo(...))
...so long...
...but there is a problem:
I can use this makro just one time in my function. I cant do things like that:
EFErr CTest::Tester(...)
{
RET_FUNKTION(Hallo(...))
RET_FUNKTION(Hallo2(...))
}
because the Variable oErr is redifined the second time.
Of course, I can shorten the makro to:
#define RET_FUNKTION(function) oErr=function;if (oErr){return oErr};
but then I have to do it like that:
EFErr CTest::Tester(...)
{
EFErr oErr;
RET_FUNKTION(Hallo(...))
RET_FUNKTION(Hallo2(...))
}
If I could use the Line in the Variable name like:
#define RET_FUNKTION(function) EFErr oErr__Line__=function;if (oErrr__Line__){return oErrr__Line__};
it will work...
...I hope this discribes my problem
|
|
|
|
|
Just more scope
What I would do is to use two brackets {}:
#define RET_FUNKTION(function) { EFErr oErr=function;if (oErr){return oErr}; } .
then you have no problem, since each oErr variable lives in its own scope.
|
|
|
|
|
|
Does anyone have code that accesses SQL thru OLE-DB they can share. I'm not looking for basic stuff, what I need are solutions for sorting and filtering rowsets...
How about an efective framework for database applications using OLE-DB, does anyone have a good pattern they may share?
|
|
|
|
|
What is the most efficient way to convert CStringArray and
CStringList objects to an alloted character buffer (ie
TCHAR* pBuffer)?
Regards,
Kosi.
|
|
|
|
|
Check out my article CShellFileOp - Wrapper for SHFileOperation. I convert a CStringList (I think, maybe it's an array, I haven't looked at the code in a while) to a double-null-terminated TCHAR buffer.
I'm not guaranteeing that this is the most efficient, though. Just one way of doing it.
|
|
|
|
|
Where i can find a sample source code for displaying html in my IE CommBand ?
Regards, Solo.
|
|
|
|
|
I have code I can share with you that shows this. There is also an example on Codeguru.com, I believe. I'll try finding and cleaning up my code so that it may be of use to you.
I'll try to do this later today.
-Erik
|
|
|
|
|
Can u send me this code ?
My e-mail: solo@dore.miem.edu.ru
|
|
|
|
|
#include <stdio.h>
int i = 7;
//The above i can be accessed using the global namespace
//:: Operator
void main()
{
int i = 10;
{
int i = 15;
{
int i = 17;
printf("%d\n",i);
//How to Access The Remaining i's here in c and c++
}
}
}
//The above variables have to be defined at the above point
|
|
|
|
|
you can't. the global i hides all of the other i's.
use different names.
-c
|
|
|
|
|
In C you can only access the local i within your block of code (equal to 17).
In C++ you can access the local i AND the global i (equal to 7). To access the global i, you'd use the scope resolution operator ( :: ) like this:
printf("%d\n", ::i);
Regards,
Alvaro
|
|
|
|
|
Looking for a c based or at a gasp c++, but prefer c, code to implement a category data structure ie
struct tagCATEGORY {
TCHAR szCategory[CATEGORYSTRINGLEN];
WORD wCategory;
} CATEGORY, FAR * LPCATEGORY;
yada yada ... Any thoughs for implementation code to copy paste and amend, best sorting methods, how to do etc thanks in advance
Andrew
|
|
|
|