Click here to Skip to main content
15,898,732 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: load mp3 and seek by samples Pin
zhu_lin11-Aug-09 23:12
zhu_lin11-Aug-09 23:12 
GeneralRe: load mp3 and seek by samples Pin
javad_200512-Aug-09 1:37
javad_200512-Aug-09 1:37 
GeneralRe: load mp3 and seek by samples Pin
zhu_lin12-Aug-09 2:55
zhu_lin12-Aug-09 2:55 
AnswerRe: load mp3 and seek by samples Pin
zhu_lin12-Aug-09 3:13
zhu_lin12-Aug-09 3:13 
GeneralRe: load mp3 and seek by samples Pin
javad_200512-Aug-09 4:14
javad_200512-Aug-09 4:14 
Questionthe way to use a DLL in Visual C++. Pin
lsh486love11-Aug-09 19:26
lsh486love11-Aug-09 19:26 
AnswerRe: the way to use a DLL in Visual C++. Pin
CPallini11-Aug-09 20:59
mveCPallini11-Aug-09 20:59 
AnswerRe: the way to use a DLL in Visual C++. Pin
Stuart Dootson11-Aug-09 21:40
professionalStuart Dootson11-Aug-09 21:40 
The CLSID, which should be recorded in the typelib somewhere.

I prefer using #import, which exposes the whole of a type-lib, including the CLSIDs.

Here's an example - I'm using Excel's _Application class (it's a COM class - you could use it via MFC's 'Add Class' route:

// Do the import - need to rename some things to avoid name collisions
#import "libid:00020813-0000-0000-C000-000000000046" version("1.6") auto_search no_dual_interfaces rename("DialogBox", "excelDialogBox") rename("RGB", "excelRGB") rename("DocumentProperties", "excelDocumentProperties") rename("SearchPath", "excelSearchPath") rename("CopyFile", "excelCopyFile") rename("ReplaceText", "excelReplaceText")

int main(int, char**)
{
   CoInitializeEx(0, COINIT_APARTMENTTHREADED);
   {
      // Create the Excel object (or get the active instance) - note
      // that the CLSID of the Excel application class is linked to
      // the structure (Excel::Application) generated for that class
      // and can be accessed using __uuidof.
      Excel::_ApplicationPtr xl;
      if (SUCCEEDED(xl.GetActiveObject(__uuidof(Excel::Application))))
      {
         std::cout << "Getting name\n";
         // We're using several auto-generated classes here (Excel
         // application, Excel workbook) - you'd have to import each
         // one separately with MFC!
         std::cout << xl->ActiveWorkbook->FullName << std::endl;
     }
   }
   CoUninitialize();
}


If you're using VC6 (which I'm guessing you are?), I'm not sure how well #import will work for you, though Frown | :-(

Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

Questionconverting WCHAR[] to BYTE[] Pin
RajeshRPR11-Aug-09 18:56
RajeshRPR11-Aug-09 18:56 
AnswerRe: converting WCHAR[] to BYTE[] Pin
Sarath C11-Aug-09 20:24
Sarath C11-Aug-09 20:24 
AnswerRe: converting WCHAR[] to BYTE[] Pin
Cedric Moonen11-Aug-09 20:34
Cedric Moonen11-Aug-09 20:34 
GeneralRe: converting WCHAR[] to BYTE[] Pin
RajeshRPR11-Aug-09 21:14
RajeshRPR11-Aug-09 21:14 
AnswerRe: converting WCHAR[] to BYTE[] Pin
Bacon Ultimate Cheeseburger11-Aug-09 20:43
Bacon Ultimate Cheeseburger11-Aug-09 20:43 
QuestionStatic Compilation in .net project/ Dependancy of EXE file over Visual Studio Installation Pin
Madhu_Rani11-Aug-09 18:44
Madhu_Rani11-Aug-09 18:44 
AnswerRe: Static Compilation in .net project/ Dependancy of EXE file over Visual Studio Installation Pin
Randor 11-Aug-09 21:46
professional Randor 11-Aug-09 21:46 
QuestionTitlebar Pin
kumar sanghvi11-Aug-09 18:32
kumar sanghvi11-Aug-09 18:32 
AnswerRe: Titlebar Pin
Sarath C11-Aug-09 20:27
Sarath C11-Aug-09 20:27 
Questionc implementation vs java implementation of bzip2 Pin
raytsu11-Aug-09 17:01
raytsu11-Aug-09 17:01 
QuestionDetermining if CListCtrl is in EditMode Pin
Mike Hankey11-Aug-09 11:08
mveMike Hankey11-Aug-09 11:08 
AnswerRe: Determining if CListCtrl is in EditMode Pin
Michael Dunn11-Aug-09 11:41
sitebuilderMichael Dunn11-Aug-09 11:41 
GeneralRe: Determining if CListCtrl is in EditMode Pin
Mike Hankey11-Aug-09 14:29
mveMike Hankey11-Aug-09 14:29 
QuestioniContextMenu on x64, inside CFileDialog Pin
Chris Losinger11-Aug-09 8:57
professionalChris Losinger11-Aug-09 8:57 
GeneralRe: iContextMenu on x64, inside CFileDialog Pin
Randor 11-Aug-09 11:05
professional Randor 11-Aug-09 11:05 
GeneralRe: iContextMenu on x64, inside CFileDialog Pin
Chris Losinger11-Aug-09 11:21
professionalChris Losinger11-Aug-09 11:21 
GeneralRe: iContextMenu on x64, inside CFileDialog Pin
harold aptroot11-Aug-09 11:21
harold aptroot11-Aug-09 11:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.