|
Rage wrote:
Is it possible that the Child Window initially have wrong system metrics
I don't know.
I have tried to overwrite MyChildFrame::Create and to modify the style before calling CMDIChildWnd::Create but nothing happened. The call to ShowWindow(SW_SHOWMAXIMIZED) - which, by the way, equals MDIMaximize() - remained a must.
But, if you want to do it with a SDI window - 100% API stuff - the metrics work perfectly and are not forgotten. You have to call ShowWindow(SW_SHOW) and the window appears as maximized. This seems to be the natural windows' behaviour - for API SDI, at least.
rechi
|
|
|
|
|
Ok tried yesterday evening. It was really that the Child window had the wrong system metrics for it to work with modifying the style in the CREATESTRUCT of PrecCreateWindow() .
Also tried with MDIMaximize() surprisingly did not work, whereas ShowWindow(SW_SHOWMAXIMIZED) works perfectly (In fact, i can rememeber i tried ShowWindow(SW_SHOWMAXIMIZED) in PreCreateWindow instead of Create before posting my initial thread, and this did not work. Solution was to do it in Create instead.
Well, it works, so lots of thanks for your help anf for you having bothered to try out.
RaGE
Sorry for the pidgin english, it's fast-written.
|
|
|
|
|
Dear All,
Good Day ...
I need to add the scrolling cabapility a propertyPage dailog how can i do that.
Plz help...
Thanks,
Best Regards,
Mohammad Zakarni
|
|
|
|
|
Does anyone of u here know how to create an OLE object in VC++??
Also, anyone have a sample source/project that allow VC++ program to add,delete,edit and search functions?? I need them urgently as i am a newbie to VC++! And are told to do a program interfacing the Microsoft Access database... I had a program that can run add,delete and edit function but i can't get my search function working... do anyone of you have a reference that i can refer to?
Thanks in advance!
Elise
|
|
|
|
|
Why this Code make the System Icon Crazy?
Can you tell me how to solve the problem?
CMainFrame::CMainFrame()
{
bFirst=true;
CShellPidl pidl((UINT)CSIDL_DESKTOP, m_hWnd);
SHFILEINFO sfi;
ZeroMemory(&sfi, sizeof(SHFILEINFO));
HIMAGELIST hSysImageList = (HIMAGELIST) SHGetFileInfo((LPCTSTR)(LPCITEMIDLIST)pidl,
0, &sfi, sizeof(SHFILEINFO), SHGFI_PIDL | SHGFI_SYSICONINDEX | SHGFI_SMALLICON);
theApp.m_smallSystemIcon.Attach(hSysImageList);
ZeroMemory(&sfi, sizeof(SHFILEINFO));
hSysImageList = (HIMAGELIST) SHGetFileInfo((LPCTSTR)(LPCITEMIDLIST)pidl,
0, &sfi, sizeof(SHFILEINFO), SHGFI_PIDL | SHGFI_SYSICONINDEX | SHGFI_LARGEICON);
theApp.m_largeSystemIcon.Attach(hSysImageList);
}
CMainFrame::~CMainFrame()
{
theApp.m_smallSystemIcon.Detach();
theApp.m_largeSystemIcon.Detach();
theApp.SalvaListe();
if (m_hLanguageDLL)
FreeLibrary(m_hLanguageDLL);
}
Best regards
Margaria Ivano
|
|
|
|
|
I want to load more that one bitmaps from files, into memory, arrange them vertically and then save the result in a single bmp file. If you know any such sample code or want to give advice then please ???
|
|
|
|
|
Hey all, justtrying to get the item which the user has doubled clicked in a WTL CListview derived class i have. Been looking and trying a few things with no luck. I'm not even sure what message I should be handling, any ideas?
thanks in advance
Luke.
|
|
|
|
|
Hi,
I am a beginner in VC++. Programatically I want to list the services Name & the port No of the service that listeing to .
Like Telnet 23
Smtp 25
http 80 etc.
Can anyone help me to find the solution of this problem?
Thanks in advance
San
|
|
|
|
|
see article
http://www.codeproject.com/system/ppsc.asp#xx207280xx
also theer is a soem code and usefule material at
http://www.15seconds.com/issue/010820.htm...guess your work is done..
this maybe useful for you..
cheers..
Himanshu
|
|
|
|
|
are there any special considerations when i need to have dialog boxes that live inside dll's?
i havnt done this before and i want to know if there are any gotchas?
many thanks
"traffic lights are for people who can't make their own decisions" biz stuff about me
|
|
|
|
|
|
see article
http://www.mindcracker.com/mindcracker/c_cafe/dll.asp
this may help you.
cheers..
Himanshu
|
|
|
|
|
I'm using softice version 3.2.
I want to set history buffer size to 2048 KB.
I try to set it with that value, and then reboot my machine.
But softice keep the history only about 200 KB.
I don't know why? Can you tell me how to set history buffer size to 2048 KB?
Thanks.
|
|
|
|
|
Back in my BeOS days, I was exposed to a faster mutex implemenation which coupled an atomic_add with a semaphore. The implementation was (in pseudo code):
Mutex constructor:
int_avail_count = 1;
sem_avail_count = 0;
Lock:
atomic_add( &int_avail_count, -1 )
if int_avail_count was 1: return
else (someone else held the mutex): wait on semaphore; for first waiter, sem_avail_count goes to -1
Unlock:
atomic_add( &int_avail_count, 1 )
if int_avail_count was 0: return
else (someone else was or would soon be waiting on the semaphore): release the semaphore; for last waiter, sem_avail_count goes to 0 again
I just encountered a situation in a Win32 app where I have a body of data which must be protected by a critical section, but will be hit often from a high-priority thread. There will be very little if any contention for this data so it's a prime candidate for this construct, which saves a trip into the kernel for a mutex acquisition. I'm therefore looking into using InterlockedIncrement/InterlockedDecrement, CreateEvent/SetEvent/WaitForSingleObject to implement this design for windows. But... On BeOS, mutexes and events were implemented as generic semaphores involving a count. It was perfectly legitimate for a thread to release a semaphore even if it doesn't own it (that was the client's responsibility to enforce). But since ReleaseMutex is documented with: "The ReleaseMutex function fails if the calling thread does not own the mutex object" it requires the use of an event. To use this design on Windows requires an event, not a mutex, and would depend on a behavior, so now the question:
First, if multiple threads are blocked on an event and a single call is made to SetEvent, does one waiting thread unblock, or all? If all, this design is not feasible. If one, on to the next question...
Second, if multiple threads are blocked on an event, and a single call is made to SetEvent, are they released in FIFO order, or arbitrary? Hopefully FIFO, as the design also depends on that behavior.
|
|
|
|
|
Brian Tietz wrote:
First, if multiple threads are blocked on an event and a single call is made to SetEvent, does one waiting thread unblock, or all?
It depends on the type of event. For auto-reset events, only one. For manual-reset, all waiting threads are released. The SetEvent() docs explain it in more detail.
Second, if multiple threads are blocked on an event, and a single call is made to SetEvent, are they released in FIFO order, or arbitrary?
Arbitrary, there is no guarantee on which thread gets woken up.
--Mike--
I'm bored... Episode I bored.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Rereading the CreateEvent docs, I do see now the statement about a single thread being released, thanks. In the process I noticed something else that I'd overlooked: that there are semaphore functions at all. With windows I'd only used events and mutexes per se and hadn't noticed semaphores. Switched to the semaphore now, works great.
Thanks,
Brian
|
|
|
|
|
Hello,
I'm trying to arrange more than 100000 items in the listview with icon style. I use ListView_SetItemPosition32 and it works fine for fewers items but having problem to arrange more items. Some items (such as 3xxx - 5xxx) goes to the top of the first item I've inserted (index 0 item) and they got -y position in the view. I've never assign nagitave position value to any item but how come the y came out to be nagitave.
Any idea why? TIA!
thanks!
|
|
|
|
|
Can remember having read something like this in the forum. Can it be that you overflow any item position variable ? Also try to use only unsigned types for item positions in your code.
Hiusing wrote:
more than 100000
Will _really_ someone use this ? Seems quite a lot of data to work with in a listview!
~RaGE();
|
|
|
|
|
With so many items in a list view you should consider to use a
"virtual" list view[^]
Angels banished from heaven have no choice but to become demons
Cowboy Bebop
|
|
|
|
|
I have a problem with converting all serialized data of MFC Object such as COleClientItem, CDocItem and CObject to XML. I would appreciate it if someone could suggest me how to solve this problem.
Thank very much for your help.
|
|
|
|
|
If the item is text, then the easiest way I can think of is with a macro, because a macro can write a variables name in place, so you can turn int Size = 5 to <Size>5</Size> very easily.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
I finally figured out how to get my dlls setup properly and exported the functions and was able to import the functions into another project. When I did this I had to add the .lib file to my project and compile the project with the lib file to be able to access the exported functions.
What I would really like to do is link to the dll Explicitly using LoadLibrary and GetProcAddress. To explain why I need to ask another question. I am going to have a series of dlls that will all export the same functions but will have different data returned depending on the dll that is called. For example each dll might have a function exported call GetNames(). If dll1 is called in might return John, Jill, Jack and Joe. If dll2 is called it might return Amber, Ally, Allen and Ashely. Now what I really wanted to be able to do is not have to recompile the the main application when I add each dll. I need a way to be able to have my main application check to see which dlls are available and then call those functions for each dll. If I have to include the .lib file for each dll won't I have to recompile the project each time I add a new dll? Or will I have to recompile the project each time no matter which style I use?
Thanks for all the help from everyone with my relentless dll questions.
-Eric
|
|
|
|
|
VanHlebar wrote:
If I have to include the .lib file for each dll won't I have to recompile the project each time I add a new dll?
yes. since you're linking to the static lib, your app will have the DLL name encoded into it somewhere.
it sounds like you're doing a plug-in system. (click here to learn more! )
if that's the case, what you need to do (IMO) is to write an interface layer between the DLLs and the code that calls the DLL. this layer will act as a proxy between your DLLs and the caller. in addition to allowing a way to call the DLL functions, it will handle DLL loading and unloading. your app can just scan a folder (or whatever) and get a list of DLLs that support your interface (just GetProcAddr for all your calls; if they're all there, the DLL is good, add it to the list).
make that proxy layer a class and instantiate one per DLL. put them all in an array and you're all set
-c
I'm not the droid you're looking for.
|
|
|
|
|
Chris Losinger wrote:
it sounds like you're doing a plug-in system. (click here to learn more! )
Chris,
I clicked but didn't go anywhere Yes it is sort of a plug-in system. The user will be able to get the extra dlls and choose which ones they want to use and which ones not to use.
I like the idea of being able to instantiate one class per dll and having an array, but I guess I would need more information on how to do just that.
Thanks for the help,
-Eric
|
|
|
|
|
somethign like this:
class CMyProxy
{
public:
CMyProxy();
~CMyProxy();
bool Load(const char *pDLLName);
RetType MyFunc1(...) {return (m_pFunc1)(...);}
RetType MyFunc2(...) {return (m_pFunc2)(...);}
protected:
FuncType1 m_pFunc1;
FuncType2 m_pFunc2;
};
CMyProxy proxy;
if (proxy.Load(pDLLFileName))
{
RetType ret = proxy.MyFunc1(whatever, whatever);
}
so, the CMyProxy class loads the DLL, gets function pointers and lets you call DLL functions through its own function wrappers.
-c
I'm not the droid you're looking for.
|
|
|
|