|
vinivc wrote: Can i customize the ListCtrl Tabs & Move them when a costomize scrollbar Moves.
Well I didn't get you. What do you mean by ListCtrl tabs. Can you be more specific.
Nibu thomas
Software Developer
|
|
|
|
|
Hi vinivc ,
What's Tabs in the CListCtrl
|
|
|
|
|
hi,
Thanks for showing intrest in solving the problem.
I mean the ListLctrl Column header(i.e the Tabs which represent the column Header ).
I want to Customize them & use a customised HScroll & Vscroll to move the
contents of ListCtrl.
"(CListCtrl class in MFC)"
|
|
|
|
|
vinivc wrote: I want to Customize them & use a customised HScroll & Vscroll to move thecontents of ListCtrl.
They are known as HeaderCtrl and MFC equivelent class is CHeaderCtrl
vinivc wrote: I want to Customize them & use a customised HScroll & Vscroll to move thecontents of ListCtrl.
get the Pointer of listCtrl Header ctrl pointer using CListCtrl::GetHeaderCtrl( ); function
|
|
|
|
|
|
I've got an old C code header I'm porting to VC++ 2005. The code implementation looks something like:
#include <mmsystem.h>
...
void Initech::MyFunction()
{
midiInAddBuffer(...);
}
Compiling this, I get the following error:
error LNK2028: unresolved token (0A000016) "extern "C" unsigned int __stdcall midiInAddBuffer(struct HMIDIIN__ *,struct midihdr_tag *,unsigned int)" (?midiInAddBuffer@@$$J212YGIPAUHMIDIIN__@@PAUmidihdr_tag@@I@Z) referenced in function "void Initech::MyFunction()" (?MyFunction@@$$FYAIPAUmidihdr_tag@@@Z) Midi.obj
With C++ not being my native tongue, I'm kind of stumped at this error; what do I need to do to resolve it? Any help would be appreciated.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: How 'bout a little guitar now?
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
you need to include winmm.lib into your build
|
|
|
|
|
|
try
#pragma comment(lib,_T("winmm.lib")) at the top of your cpp file where you calling Window multimedia related function
|
|
|
|
|
Thanks, I'll give that a try.
|
|
|
|
|
I've inherited an old vc++ 6 project, and loaded it into 2005.
Cleaning up the project, I tried removing a file called resource.hm, which contained the following line:
<br />
#define HIDC_TEST_LIST 0x80d43575 // IDD_TEST_DIALOG [Neutral]<br />
The IDD_TEST_DIALOG dialog does not exist in the project, nor are any of the resources defined as Neutral.
I also removed the following lines from the .rc file:
<br />
#define APSTUDIO_HIDDEN_SYMBOLS<br />
#include "resource.hm"<br />
#undef APSTUDIO_HIDDEN_SYMBOLS<br />
When I build, the lines are auto-generated in the resource script, and an empty resource.hm is created, causing a compile error.
From MSDN:
Your project's resource.hm file will only be created by the development environment when one or more dialog boxes have controls and when those controls have HelpID properties set to True in the Properties Window.
I scanned the .rc script for any references of HIDC_TEST_LIST, and none were found. I scanned for other HelpIDs, nothing. How in the heck do I get rid of this thing?
Montreal great Guy Lafleur, quoted by CBC on being mugged while vacationing recently in Buenos Aires: "I didn't have any time to react before I got a sucker-punch in the eye. It was like one of the players from the Bruins."
|
|
|
|
|
Delete and re-create the resource file, at least thats how I get it to work when loading problematic files into VC6.
|
|
|
|
|
Well I was able to recreate your problem. Then I was able to fix it too.
One or more of the controls in the dialog could be having help id s. Set this property(Help ID) to false. Each control in a dialog has got this property. Once you set this to false the lines that you mentioned
Jack Squirrel wrote: // Generated Help ID header file
#define APSTUDIO_HIDDEN_SYMBOLS
#include "resource.hm"
#undef APSTUDIO_HIDDEN_SYMBOLS
will not be regenerated. This should fix the errors that come up.
Help ids are located in resource.hm . Once you delete the above statement you are bound to get errors because the file is no more included and the symbols are undefined.
Nibu thomas
Software Developer
|
|
|
|
|
Nibu thomas wrote: One or more of the controls in the dialog could be having help ids.
Yep. I searched for HID* in the .rc file and didn't find anything. I thought it might be corrupted, since if a control was set to true, it's label should be appearing in the .hm file. I then went through each dialog (100+) in the resource editor, selecting all controls and ensuring the HelpID was false. One of the dialogs had it set to true for all controls, but all of the controls were unlabelled. (set to their ID numbers)
I created a new project, set the HelpID flag to true, and changed the ID to a number. (1001) Sure enough it failed to compile.
I tried changing the ID to TEST, and it wrote the help ID in the .hm as HTEST. I guess the HelpID writer doesn't like IDs starting with numbers - H1001 should be a valid label for a #define.
Montreal great Guy Lafleur, quoted by CBC on being mugged while vacationing recently in Buenos Aires: "I didn't have any time to react before I got a sucker-punch in the eye. It was like one of the players from the Bruins."
|
|
|
|
|
Hi ,
This is my first posting over here. Hope to have great answers here.
I have a (Dialogbox with a button) which I open from the Menu which is
vertical shaped and docked at the left side.
I click this button on the dialogbox and AfxMessagebox is flashed which
is at the center of the dialogbox . In that way its flashing at the
left side. I call a App's DisplayMessage function in order to show this
messagebox. I though if I display this dialog from App , it may come at
the center but that is not the case.
I want this AfxMessageBox to be flashed at the center of the frame.
I read few postings here. I used following code using SetWindowsHookEx.
Sombody before said to subclass the window of AfxMessageBox in the hook
procedure . I am not sure how to do it and after that how to reposition
the window at the center of the main framme/App. So I straightaway used
SetWindowPos but not working satisfactorily.
HHOOK hookSave;
LRESULT CALLBACK hookFunc(int nCode, WPARAM wParam, LPARAM lParam)
{
if ( HCBT_CREATEWND == nCode )
{
#define pcs (((LPCBT_CREATEWND) lParam)->lpcs)
HWND hwndSave = 0;
if( WC_DIALOG == pcs->lpszClass )
{
hwndSave = (HWND) wParam;
}
if ( hwndSave )
{
// subclass_dialog_any_which_way_you_want(hwndSave);
SetWindowPos(hwndSave,HWND_TOP, 10,50,500,300,SWP_SHOWWINDOW);
//MoveWindow(hwndSave,100,500,500,300,false);
//theApp.m_pMainWnd->SubclassWindow(hwndSave);
}
#undef pcs
}
return CallNextHookEx(hookSave, nCode, wParam, lParam);
}
void CLeeApp::DisplayMessage()
{
hookSave = SetWindowsHookEx(WH_CBT, hookFunc, NULL,
::GetCurrentThreadId());
AfxMessageBox("Just for check");
UnhookWindowsHookEx(hookSave);
}
I guess this related to making AfxMessageBox as a SubClassWindow to
MainFrame which should be subclassed in the hook function (Which I dont
know how to do in the hookfunction, means hot to get the main frame
handle) and then how to get the windproc of mainframe for afxmessagebox
and then hot to get all these things to work for Afxmessagebox to
center the mainframe
Could someone help me with some guiding code postings.
It will help me a lot.
Thank you,
Lee
|
|
|
|
|
Instead of using AfxMessageBox() , use the CWnd::MessageBox() method on the window you want the message box to be centred in, ie. If you want the message box centred on your main frame, call AfxGetMainWnd()->MessageBox(...) .
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Thanks RYan ,
It helped
Just for learning purpose.
How to achieve it with AfxMessageBox using SetWindowsHookEx
and hook procedure?
How to subclass AfxMessageBox window to main window in the hook procedure and then how to to resize it. (please refer my code).
Thanks,
lee
|
|
|
|
|
yang__lee wrote: How to achieve it with AfxMessageBox using SetWindowsHookExand hook procedure?
I wouldn't ever do it that way, so I don't know how you'd do it.
yang__lee wrote: How to subclass AfxMessageBox window to main window in the hook procedure and then how to to resize it.
Message boxes are automatically sized? Why do you need a different size?
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
In the name of code reuse, does anyone have pointers to articles that give examples of how to automate another app?
Scenario: I'm writing an app that helps me do part of my job much faster. However, I must still manually copy and paste data from an existing .NET app into mine.
Therefore, I'm looking for code examples of how to programmatically control the other app the way I would do so manually.
Ex:
1) F4, enter data, press enter
2) Copy from fields
3) etc.
Most of this I can guess, FindWindow (to locate app's main window), figure out how to send keystrokes, GetWindowText on specific windows, etc. I'm just hoping someone's already done something I can use real quick instead of blowing a few hours stumbling through it.
Tom Archer (blog)
Program Manager
MSDN Online (Windows Vista and Visual C++)
MICROSOFT
-- modified at 23:47 Monday 27th March, 2006
|
|
|
|
|
Tom Archer - MSFT wrote: Most of this I can guess, FindWindow (to locate app's main window), figure out how to send keystrokes, GetWindowText on specific windows, etc. I'm just hoping someone's already done something I can use real quick instead of blowing a few hours stumbling through it.
Is this[^] what you want?
Nibu thomas
Software Developer
|
|
|
|
|
Thanks Nibu. That gets me the SendKeys bit, but the hardest part is getting the data from other app. Generally, that's not too difficult with a standard Windows app. However, it's a .NET app so I'm not sure how to programmatically find the specific windows I need. Looking at Spy++, I can see several issues: 1) they all have the same class name, 2) what I would normally see as a listbox evidently is something else and so on.
Therefore, what I'm looking for is an example of a C++ program driving a .NET application and basically screen scraping from the .NET apps windows.
Tom Archer (blog)
Program Manager
MSDN Online (Windows Vista and Visual C++)
MICROSOFT
|
|
|
|
|
Tom Archer - MSFT wrote: However, it's a .NET app so I'm not sure how to programmatically find the specific windows I need. Looking at Spy++, I can see several issues: 1) they all have the same class name, 2) what I would normally see as a listbox evidently is something else and so on.
With a .NET Framework-based application, the window messages and classes intercepted by Spy++ don't correspond to anything useful. You want to see managed events and property values. See here for more.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Yep. I remembered this article last night. It's not 100% what I wanted in that it doesn't show how to find a particular window or what I'm capable of searching for, but it's definitely a start.
Thanks David.
Tom Archer (blog)
Program Manager
MSDN Online (Windows Vista and Visual C++)
MICROSOFT
|
|
|
|
|
Can anyone tell me what are the diiferences between Visual C++ and Managed Extensions for Visual C++, in terms of code, not architecture? I'm relatively new to VC++.
|
|
|
|
|
Are you looking for MC++ or CLI?
MC++ is the original Managed Extensions syntax for writing .NET code with C++
C++/CLI is the new syntax introduced with Visual C++ 2005
Tom Archer (blog)
Program Manager
MSDN Online (Windows Vista and Visual C++)
MICROSOFT
|
|
|
|