|
Hi,
How do i extract the icon of an associated file.
any help will be helpfull.
Thanx in advance
Prakash.
The World is getting smaller and so are the people.
|
|
|
|
|
SHGetFileInfo() will retrieve the index of the file's icon in the system image list.
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
The other way is:
1.Get full path to the associated program
2.Get default icon
3.Use ExtractIcon on it
Example: *.htm
1.Look for default value of HKCR\\*.htm (it is htmlfile)
2.Find default value of HKCR\htmlfile\DefaultIcon
This is C:\Program Files\Internet Explorer\iexplore.exe,1
3.Call ExtractIcon with iexplore.exe, first icon
Peter Molnar
|
|
|
|
|
Hi
Does anyone have the file window.h to linux?
I need the file for using QueryPerformanceCounter and QueryPerformanceFrequence.
Thank for your time
|
|
|
|
|
jsut the header file is not going to satisfiy your problem, you also need windows library also, now linking windows lib and .h file in linux,hummm well as far as i know, its not possiable..
you sould look for similar thing that linux offers.
regards,
prakash.
The World is getting smaller and so are the people.
|
|
|
|
|
|
I am using files with <fstream.h>. My objective is be appending data to a file in its first line, for example:
11111 -> 22222 -> 33333 -> 44444
11111 22222 33333
11111 22222
11111
My code, executed each five minutes:
arxiu.open(FileName,ios::app);
arxiu.seekp(ios::beg);
arxiu<<data<<endl;
arxiu.close();
... but="" it="" doesn't="" work...the="" code="" does:="" 11111="" -=""> 11111
22222
I'll thank any help.
|
|
|
|
|
Try the below code
I hope it may be work
else i will try and say
arxiu.open(FileName,ios::app);
arxiu.seekp(ios::end);
arxiu<
|
|
|
|
|
Sorry but It doesn't work.
thanks
Christian
|
|
|
|
|
I have been using a 3rd party manufactores PCI databus card API.
Now other people have been using a simular card and API within the company.
So the idear of each writing a library for their manufactures API with a common set of procedures was raised.
I am attempting to write my library first, but the only time I tried to create a library I kept running into problems, linking etc.
Any good examples/notes. The term Static library was muted.
Note the libray must be usable for Win32 MFC and Win32 console applications.
|
|
|
|
|
Hi, I have searched those articles and posts in CP, but found nothing talking about using the ActiveX control, Microsoft ADO Data Control, with Visual C++.NET (V7.0 / V7.1).
What I have learned:
1) Insert the adodc (ADO Data Control) into the dialog box.
2) Configure the properties (the connection string, the record sourcce, etc).
3) Bind to a MS DataGrid Control to display data.
What I would like to know about how to program the ADO Data Control / MS DataGrid Control in my code for the following purposes:
1) Enumerate all the tables / views in an Access Database.
2) Change the record source from Table_A to Table_B programmatically and refresh the MS DataGrid Control.
3) How to use ADO Data Control to navigate data without the MS DataGrid Control.
Thanks in advance!
Maxwell Chen
|
|
|
|
|
What I have learned:
1. The ADO Grid and ADO data control need fixed connection string. You have to start from some existing database and then after succesfull compilation figure out where this string is assigned to ADO control in order to provide your own.
2. The same procedure is applicable.
3. semms no way.
4. I am not sure that everything will work with Access 2000 database format.
default:
1. Create a global own database workspace, global dabase object, global connection string an so on. I do in by forward declaration in a separate header file like global.h. This file will be included in all relevant source files later when you actually switch from one database/table to an other.
2. in a global.cpp define those objects.
3. Table enumeration is given in the database object by a simple request to get a query/table N1,2,3 or by direct access to the system tables, hidden inside any Microsoft database.
4. I could not start ADO datagrid anyway. It was too much additional coding for my simple tasks.
5. You can combine several database in a one project by keeping several workspaces, databases and so on.
6. Once you get ADO table to work with any table prescibed, you can use objects dynamically in order to represent any table you want at any moment.
Serge Chychkan
|
|
|
|
|
HI. Now I'm trying to programming MS DataGrid Control, but have some problams. If you can - send me your project in zip. I'll trying help you.
My e-mail:
keeper_@km.ru
bilas.
|
|
|
|
|
Hi !
I'm using Visual C++ 6. During the night, there is a nightly build of our application and each morning, a batch will copy on my computer a 'fresh version' of the .h and .cpp files, as well as all other files used by Visual C++.
Since a few days, we are using a precompiled header, and now, each morning, when I try (after a small change) to recompile my app, I get this error :
fatal error C1853: '../debug/Sylvie.pch' is not a precompiled header file created with this compiler
What can I do to get rid of this problem. Right now, the only way I found is to rebuild the whole application, but it takes too much time !!!!
Any ideas ?
Thanks !
Jerome
|
|
|
|
|
Hi
Under Project, Settings,C++,Catagory, Precompiled Headers radio button Do not use pch.
Best Wishes and Happy Turkey Day,
ez_way
|
|
|
|
|
But I DO want to use pch, otherwise it takes too long to rebuild.
|
|
|
|
|
Rebuilding the application not build solves this problems.
The World is getting smaller and so are the people.
|
|
|
|
|
Yes, but I want to avoid to rebuild the whole application because it takes a long long time.
What I just want to know is why I get the problem I mentionned in my post, and how to avoid it WITHOUT having to rebuild all AND without getting rid of the precompiled header.
Jerome
|
|
|
|
|
The network machine and your machine are both using different versions of the compiler. One of you need to upgrade to the same level as the other. The best option would be to apply the most recent VC6 service pack to all machines, and then you will not have any problems.
Roger Allen - Sonork 100.10016
If your dead and reading this, then you have no life!
|
|
|
|
|
I'm a real newbie to c++, and I've just started to code my first windows app, and i would just like to know how to put separators in between buttons on my toolbar that is created dynamically at runtime.
TBBUTTON menButts[8];
TBADDBITMAP tbab;
//Many, Many lines of Code
ZeroMemory(menButts, sizeof(menButts));
menButts[0].iBitmap = STD_FILENEW;
menButts[0].fsState = TBSTATE_ENABLED;
menButts[0].fsStyle = TBSTYLE_BUTTON;
menButts[0].idCommand = ID_FILE_NEW;
menButts[1].iBitmap = STD_FILEOPEN;
menButts[1].fsState = TBSTATE_ENABLED;
menButts[1].fsStyle = TBSTYLE_BUTTON;
menButts[1].idCommand = ID_FILE_OPEN;
menButts[2].iBitmap = STD_FILESAVE;
menButts[2].fsState = TBSTATE_ENABLED;
menButts[2].fsStyle = TBSTYLE_BUTTON;
menButts[2].idCommand = ID_FILE_SAVEAS;
//Seperator
menButts[3].iBitmap = STD_PRINT;
menButts[3].fsState = TBSTATE_ENABLED;
menButts[3].fsStyle = TBSTYLE_BUTTON;
menButts[3].idCommand = ID_FILE_PRINT;
//Seperator
menButts[4].iBitmap = STD_CUT;
menButts[4].fsState = TBSTATE_ENABLED;
menButts[4].fsStyle = TBSTYLE_BUTTON;
menButts[4].idCommand = ID_EDIT_CUT;
menButts[5].iBitmap = STD_COPY;
menButts[5].fsState = TBSTATE_ENABLED;
menButts[5].fsStyle = TBSTYLE_BUTTON;
menButts[5].idCommand = ID_EDIT_COPY;
menButts[6].iBitmap = STD_PASTE;
menButts[6].fsState = TBSTATE_ENABLED;
menButts[6].fsStyle = TBSTYLE_BUTTON;
menButts[6].idCommand = ID_EDIT_PASTE;
//Seperator
menButts[7].iBitmap = STD_UNDO;
menButts[7].fsState = TBSTATE_ENABLED;
menButts[7].fsStyle = TBSTYLE_BUTTON;
menButts[7].idCommand = ID_EDIT_UNDO;
//calculates the number of buttons in our toolbar
SendMessage(hTool, TB_ADDBUTTONS, sizeof(menButts)/sizeof(TBBUTTON), (LPARAM)&menButts);
Any help would be appreciated
|
|
|
|
|
Hi
TBSTYLE_SEP 0x0001
menButts[0].iBitmap = STD_FILENEW;
menButts[0].fsState = TBSTATE_ENABLED;
menButts[0].fsStyle = TBSTYLE_BUTTON;
menButts[0].idCommand = ID_FILE_NEW;
menButts[0].idsep = TBSTYLE_SEP; //0x0001
menButts[1].iBitmap = STD_FILEOPEN;
menButts[1].fsState = TBSTATE_ENABLED;
menButts[1].fsStyle = TBSTYLE_BUTTON;
menButts[1].idCommand = ID_FILE_OPEN;
Best Wishes and Happy Turkey Day,
ez_way
|
|
|
|
|
I want my dialog to sometimes show a ToolTip when it opens up (when the dialog opens up).
I want to do thsi regardless of wether the user is hovering over a specific control or anything of that kind.
I've been looking for something like CToolTipCtrl::ShowMeNow(...) but alas I couldn't find one.
I found that TTM_POPUP should do the deal, but it's defined for XP and above only :
#if (_WIN32_WINNT >= 0x0501)
#define TTM_POPUP (WM_USER + 34)
can someone please help ?
thanks
|
|
|
|
|
So write one!
void MyApp::DisplayToolTip(CPoint& pt,CString* m_pMyToolTip)
{
CString str = m_pMyToolTip);
if (str.IsEmpty())
return;
SetWindowPos(NULL,il, it,iw, ih, SWP_SHOWWINDOW|SWP_NOCOPYBITS|SWP_NOACTIVATE|SWP_NOZORDER);
}
Now you finish it!
Good luck and best wishes,
Marty
Best Wishes and Happy Turkey Day,
ez_way
|
|
|
|
|
I have done a keyboard hook and in my callback function i have to check for
each character
if (wParam >= VK_NUMPAD0 && wParam <= VK_NUMPAD9)
then it is checking correctly for numeric keypad nos
but if i want to check for
if (wParam =VK_A)
then it is giving an error
undeclared indentifier vk_A
but i havent declared for vk_numpad0
Are there anybody to help me
|
|
|
|
|
If you look in the header file where VK_NUMPAD0..9 etc are declared you will see that VK_A..VK_Z do not exist, but map directly onto the charaters 'A'..'Z' which can be used in their place.
if (wParam == 'A')
Roger Allen - Sonork 100.10016
If your dead and reading this, then you have no life!
|
|
|
|