|
Thank you but can you tell me how to do it in Win32 SDK (no MFC)
for example using ODBC or ADO!
|
|
|
|
|
Look in MSDN and Platform SDK - they have bunch of examles.
|
|
|
|
|
Thank you but can you tell me how to do it in Win32 SDK (no MFC)
for example using ODBC or ADO! (I want to load an mdb file)
|
|
|
|
|
Hi,
I would like to know why calling the function 'MySHEnumFolderContent( "c:\",SHCONTF_FOLDERS | SHCONTF_NONFOLDERS | SHCONTF_INCLUDEHIDDEN,NULL, 0 )' multiple times, the number of pages currently resident in memory (memory usage) always grows up (I used the Windows XP Task Manager to measure the memory usage)?
Thanks,
Ana
int MySHEnumFolderContent( LPSHELLFOLDER pFolderPai,
LPITEMIDLIST pItem,
DWORD dwFlags,
FOLDERCONTENTPROC pfn /*= NULL*/,
LPARAM lParam /*= 0*/,
LPITEMIDLIST* ppidl /*= NULL*/ )
{
int NumItens = -1;
LPSHELLFOLDER pFolder = NULL;
HRESULT hr = pFolderPai->BindToObject( pItem, 0,
IID_IShellFolder,(LPVOID *)&pFolder );
if ( SUCCEEDED( hr ) )
{
LPENUMIDLIST pEnumIDList = NULL;
hr = pFolder->EnumObjects( NULL, dwFlags, &pEnumIDList );
if ( SUCCEEDED( hr ) )
{
LPMALLOC pMalloc = NULL;
LPITEMIDLIST pidl = NULL;
SHGetMalloc( &pMalloc );
NumItens = 0;
while ( pEnumIDList->Next( 1, &pidl, NULL ) == S_OK )
{
if ( pfn != NULL && !pfn( pFolder, pidl, lParam ) )
{
// Returns the current PIDL
if ( ppidl != NULL )
*ppidl = pidl;
break;
}
NumItens++;
pMalloc->Free( pidl );
pidl = NULL;
}
pMalloc->Release();
pEnumIDList->Release();
}
pFolder->Release();
}
return ( NumItens );
}
/*---------------------------------------------------------------------------*/
int MySHEnumFolderContent( LPCTSTR pNomeFolder,
DWORD dwFlags,
FOLDERCONTENTPROC pfn /*= NULL*/,
LPARAM lParam /*= 0*/,
LPITEMIDLIST* ppidl /*= NULL*/ )
{
int NumItens = -1;
LPSHELLFOLDER pDesktopFolder = NULL;
// Get an IShellFolder interface pointer
HRESULT hr = SHGetDesktopFolder( &pDesktopFolder );
if ( SUCCEEDED( hr ) )
{
LPITEMIDLIST pItem = NULL;
hr = MySHPathToPIDL( pNomeFolder, &pItem, pDesktopFolder );
if ( SUCCEEDED( hr ) )
{
LPMALLOC pMalloc = NULL;
NumItens = MySHEnumFolderContent( pDesktopFolder, pItem, dwFlags, pfn, lParam, ppidl );
SHGetMalloc( &pMalloc );
pMalloc->Free( pItem );
pMalloc->Release();
}
pDesktopFolder->Release();
}
return ( NumItens );
}
/*----------------------------------------------------------------------------*/
HRESULT MySHPathToPIDL( CString szPath, LPITEMIDLIST *ppidl,
LPSHELLFOLDER pFolder /*= NULL*/ )
{
HRESULT hr;
LPSHELLFOLDER pShellFolder = NULL;
OLECHAR wszPath[ MAX_PATH ] = { 0 };
ULONG nCharsParsed = 0;
BOOL bFreeOnExit = FALSE;
// Use the desktop's IShellFolder by default
if ( pFolder == NULL )
{
hr = SHGetDesktopFolder( &pShellFolder );
if ( FAILED( hr ) )
return ( hr );
bFreeOnExit = TRUE;
}
else
pShellFolder = pFolder;
if( szPath.Right( 1 ) == ':' )
szPath += "\\";
// Convert the path name to Unicode
MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, szPath, -1, wszPath, MAX_PATH );
// Call ParseDisplayName() to do the job
hr = pShellFolder->ParseDisplayName( NULL, NULL, wszPath,
&nCharsParsed, ppidl, NULL );
// Clean up
if ( bFreeOnExit )
pShellFolder->Release();
return hr;
}
|
|
|
|
|
hi,
im unable to cast an integer into either a VARIANT or _variant_t. Does anyone know how i can place an integer into a variant variable? (i need to do this so that i can place a _variant_t into a new field - ADO style)
Does anyone know how to do this?
|
|
|
|
|
try a long or short instead. _variant_t has a constructor that takes either of them.
in a VARIANT (v), set v.lVal to the integer value and v.vt to VT_I4
and try reading the documentation in future
HTH
--
Ian Darling
|
|
|
|
|
oops, thanks, that didnt even cross my mind (the long and short bits, i did read the documentation but was specifically looking for int) cheers
|
|
|
|
|
Hi:
As you know whenever you right-click on the Sound Files for example .MP3 files and click on "Properties" item
from
context menu,Windows extract some information about .MP3 file such as Title,Artist,Album,Year,Comment,Genre,...
and show them in the "Summary" property sheet. Now i want to know where do this information store?
I know that this info store in the portion of file called "Header",But Which offset ? In general how can i find this info
for any file? for example you know .MDB files(database in access),the name of it's fields,number of fields,.....where
do they store? is there any catalog or Webpage,URL,html help such as MSDN or...... to achieve this purpose?
Please help me.
my english isn't very well because it isn't my native language,Please excuse me for bad comments.
Thanks a lot.
|
|
|
|
|
Well, MP3 files store their information (title, track, etc) a bit different.
This is for the ID3V1 tag: http://home.swipnet.se/grd/mp3info/tag/index.html
And there's also a ID3V2 track which uses a "real" header, i.e. at the beginning of the file.
Files in generals may have all a different header, so it is hard to say what a header looks like and where it begins.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hi everyone,
I was wondering, is it possible to open a doc file by just using WIN32 APIs and not using any GUIs stuff.
Thanks in advance,
Ken
|
|
|
|
|
Sure - using the Office object model and COM.
Phil Boyd
MCP
CPT, AR
You may be gone, but we will never forget your sacrifice.
"Proud to be an American..." Lee Greenwood
|
|
|
|
|
Hi, thanks for the response.
I looked up the Office Object Model references on the MSDN site but all I can find is stuff for VB, I’m looking for C++ code.
Thanks again,
Ken
|
|
|
|
|
In VC++ - if you do a #import on mso9.dll (I think that's it) - you will get ATL wrappers for the COM objects. The VB code samples can be converted to C++ somewhat (I won't say fairly) easily.
Phil Boyd
MCP
CPT, AR
You may be gone, but we will never forget your sacrifice.
"Proud to be an American..." Lee Greenwood
|
|
|
|
|
As part of my continuing quest to stress-test my app...
.. I'd like to find an app that can force page faults to occur on a regular basis, or barring that, code to do the same.
yes, I could figure it out, but time is tight, and it's quicker to get things off the shelf if they're already there.
Any suggestions?
Thankee-sai
|
|
|
|
|
How can I add 3 header files to my precompiled header (.PCH)?
Tanks.
|
|
|
|
|
Just a guess...
Include'em into stdafx.h or stdafx.cpp?
Brian
|
|
|
|
|
stdafx.h is the right one.
It took me a while to sort this out but the best way to set up the PCH stuff is for stdafx.cpp to have just one include file - stdafx.h and set it to Create precompiled header using stdafx.h. All other source modules should be set to Use precompiled header through stdafx.h. This can make a large difference in compilation times.
The Ten Commandments For C Programmers
|
|
|
|
|
How do I send a message from the CMainFrame to CView?
This seems like a simple question but I just can't find it in my books.
Any help appreciated, thanks
Ali
|
|
|
|
|
Read FAQ.
SDI: CView *pView = AfxGetMainWnd()->GetActiveView();
MDI: CView *pView = AfxGetMainWnd()->MDIGetActive()->GetActiveView();
pView->PostMessage(WM_MESSAGE);
|
|
|
|
|
Hello,
in our company Linux programming is growing, but Windows is also required.
We now examine WxWindows (www.wxwindows.org) which seems a little bit similar to MFC (i.e. event handling).
Are here any experiences with wxwindows in this Forum ?
regards
Frank
|
|
|
|
|
Hello,
I'd like to experiment a bit with using IE to do my dialogs, so that making dialogs would be as easy as editing html. For that I'd have to somehow 'trap' eg clicks on a button in a form, and handle them furter in my application. I know this sort of stuff is possible, but I can't find any documentation on it; I've been looking through msdn but all I get there are some vague descriptions of the various ISomething interfaces. I was more looking for an overview of what is possible and how hard it is. Thanks.
cheers,
roel
|
|
|
|
|
|
These links were exactly what I was looking for, thanks a lot!
cheers,
roel
|
|
|
|
|
Hello,
I'd like to ask you a question about the links that you've given to Roel:
I also use the Paul DiLascia's HTMLCtrl, but I've noticed that each time I navigate to somewhere and then destroy the parent dialog (of the HTMLCtrl) the app leaks some handles.
Have you noticed it too?
I've posted a question to Mr. DiLascia, but meanwhile I'm searching for possible answers...
NOTE:
I've noticed this using perfmon.
Thank you in advance.
|
|
|
|
|
How can I convert an int variable to string? The following code outputs "Yesb" instead of "Yes98":
string s = "Yes" ;<br />
int a = 98 ;<br />
s += a ;<br />
<br />
cout << s << endl ;
Is there a way to do it without using CString?
-----------------------
But what did I do?
|
|
|
|
|