Click here to Skip to main content
16,005,473 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to create an installation program for my program? Pin
Larry Antram14-Dec-04 15:08
Larry Antram14-Dec-04 15:08 
GeneralRe: How to create an installation program for my program? Pin
momer14-Dec-04 15:58
momer14-Dec-04 15:58 
GeneralMFC dialog box menu weirdness Pin
Uncle Vance14-Dec-04 14:37
Uncle Vance14-Dec-04 14:37 
QuestionCan some body help me.... Pin
Indra_Putra14-Dec-04 13:34
Indra_Putra14-Dec-04 13:34 
AnswerRe: Can some body help me.... Pin
Maximilien14-Dec-04 14:19
Maximilien14-Dec-04 14:19 
AnswerRe: Can some body help me.... Pin
BRIMID15-Dec-04 1:49
BRIMID15-Dec-04 1:49 
GeneralPrint image with DrawImage in GDI+ Pin
giannibal14-Dec-04 12:36
giannibal14-Dec-04 12:36 
Generalgetting icon Pin
pnpfriend14-Dec-04 11:26
pnpfriend14-Dec-04 11:26 
Hi ..
Is there anyway.. to get the icon for the given file name? in c++?
I tried to convert following vb code to c++ using VS.Net. but I got errors
<br />
 Function GetIconLocation(ByVal filename As String, ByVal index As Integer) As String<br />
 Dim loc As String<br />
        'Use this to get the small icon.<br />
        Dim shinfo As SHFILEINFO<br />
        shinfo = New SHFILEINFO<br />
        Dim hImgSmall As IntPtr  'The handle to the system image list.<br />
<br />
        hImgSmall = SHGetFileInfo("c:\" & filename, 0, shinfo, Marshal.SizeOf(shinfo), SHGFI_ICON Or SHGFI_LARGEICON)<br />
        Dim hIcon As Icon<br />
        'hIcon = hIcon.FromHandle(hImgSmall)<br />
        hIcon = Icon.FromHandle(shinfo.hIcon)<br />
        Dim bip As System.Drawing.Bitmap<br />
        bip = hIcon.ToBitmap()<br />
        loc = "c:\icon" & index.ToString & ".png"<br />
        bip.Save(loc)<br />
        loc = "<img src=""" & loc & """><br><font size=""-2"" face=""Times"">" & filename & "</font>"<br />
        shinfo = Nothing<br />
        Dim f As File<br />
        f.Delete("c:\" & filename) ' delete the file<br />
        GetIconLocation = loc

end Function


I tried to used
<br />
#using <mscorlib.dll><br />
#using <System.dll><br />
using namespace System;<br />
using namespace System::IntPtr;<br />

I dont' know how to use those namespace System classes from regular c++ in Visual Studio .Net.

Can anyone help me please?
Thank you.


but
GeneralRe: getting icon Pin
David Crow15-Dec-04 4:23
David Crow15-Dec-04 4:23 
GeneralReading data from Serial Port. Pin
CNewbie14-Dec-04 10:34
CNewbie14-Dec-04 10:34 
GeneralRe: Reading data from Serial Port. Pin
wwwhb200014-Dec-04 14:00
wwwhb200014-Dec-04 14:00 
GeneralFreeing up memory Pin
poiut14-Dec-04 10:29
poiut14-Dec-04 10:29 
GeneralRe: Freeing up memory Pin
David Crow15-Dec-04 2:05
David Crow15-Dec-04 2:05 
GeneralRe: Freeing up memory Pin
poiut15-Dec-04 6:28
poiut15-Dec-04 6:28 
GeneralRe: Freeing up memory Pin
poiut15-Dec-04 6:34
poiut15-Dec-04 6:34 
GeneralMFC File Input and Output problem Pin
Member 158681214-Dec-04 10:25
Member 158681214-Dec-04 10:25 
GeneralCHtmlView + focus Pin
iifisher14-Dec-04 10:21
iifisher14-Dec-04 10:21 
GeneralRegister an Active X Control Pin
jerry1211a14-Dec-04 9:56
jerry1211a14-Dec-04 9:56 
GeneralRe: Register an Active X Control Pin
Graham Bradshaw14-Dec-04 10:42
Graham Bradshaw14-Dec-04 10:42 
Generalproblem with long c++ file Pin
dolph_loe14-Dec-04 9:51
dolph_loe14-Dec-04 9:51 
GeneralRe: problem with long c++ file Pin
Sawatzky14-Dec-04 10:55
Sawatzky14-Dec-04 10:55 
GeneralRe: problem with long c++ file Pin
Todd Smith14-Dec-04 11:19
Todd Smith14-Dec-04 11:19 
Questionhow does dialog catch char input? Pin
LeeeNN14-Dec-04 9:08
LeeeNN14-Dec-04 9:08 
AnswerRe: how does dialog catch char input? Pin
David Crow14-Dec-04 9:47
David Crow14-Dec-04 9:47 
GeneralRe: how does dialog catch char input? Pin
LeeeNN14-Dec-04 10:26
LeeeNN14-Dec-04 10:26 

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.