|
iHave a CDialog and i want to start my dialog maximized how ? because my dialog is minimized it is small and i don t want to push the buton "maximized" !
Bravoone
|
|
|
|
|
During Creation Override OnInitDialog function and
add this ModifyStyle(0, WS_MAXIMIZE); to your code.
Like
void CMyDialog::OnInitDialog()
{
CDialog::OnInitDialog();
ModifyStyle(0, WS_MAXIMIZE);
}
|
|
|
|
|
You can use of ShowWindow(SW_MAXIMIZE)
|
|
|
|
|
THANKS GUYS !!!!
ShowWindow(SW_MAXIMIZE) IS WORKING !!!!
Bravoone
|
|
|
|
|
Glad you found it
|
|
|
|
|
I need to copy some string to the clipboard.
This is the code I use:
handle = GlobalAlloc(GMEM_MOVEABLE,text.GetLength()+1);
if (handle)
{
if (OpenClipboard(hWnd) && EmptyClipboard() )
{
out = (char*)GlobalLock(handle);
My code sometimes fail at out = (char*)GlobalLock(handle);
GlobalLock returns NULL and GetLastError() = 6 (invalid handle).
Any ideas why ?
Is there more reliable code for copying to clipboard ?
Thank you!
rrrado
|
|
|
|
|
I ran across the following code in one of our projects - not sure if it will help you or not
<br />
HGLOBAL hData = 0;<br />
CSharedFile clipb (GMEM_MOVEABLE|GMEM_DDESHARE|GMEM_ZEROINIT);<br />
clipb.Write(cstrString, cstrString.GetLength()*sizeof(TCHAR));<br />
clipb.Write(_T("\0"), sizeof(TCHAR));<br />
hData = clipb.Detach();<br />
if (hData)<br />
{<br />
VERIFY(OpenClipboard());<br />
SetClipboardData(CF_TEXT, hData);<br />
VERIFY(CloseClipboard());<br />
}<br />
cje
|
|
|
|
|
Thank you. I think I've fouind the problem - I was releasing the memory after SetClipboardData which caused the problems.
rrrado
|
|
|
|
|
Hi all,
I have two dll
1)DLLHook- global hook dll
2)BHODLL- a BHO dll
and a server application
3) DlgApp
in DLL hook i have
#pragma data_seg(".shared")
map<_tstring,_tstring> g_map;
// Other objects
##pragma comment(linker, "/section:.shared,RWS")
In DlgAPP, I am inserting some values in map.
Now I have to use these value in BHODLL.
While I debug the BHO, i do not see and values in the map. As per my understanding the global data section will be avaible in all the process after installing hook.so the map should be avaible in BHO code.
Is these possible? or I am doing something wrong?
Thanks in advance.
Regards
Abhi Lahare
|
|
|
|
|
That can not work. This is because a map is allocates memory on the heap which does not work using shared data segments because the heap is not part of the shared data segment. You need to use a structure that at compile time allocates the maximum storage necessary and does this in the shared data segment.
John
|
|
|
|
|
Or create a memory mapped file and don't use a shared data segment at all...
Any sufficiently gross incompetence is nearly indistinguishable from malice.
|
|
|
|
|
Hi,
I want to create vertical tab pages, with bitmap images on the title of each property page, using CPropertyPage. Can anyone tell me how to do this? I tried to paint on the title of the page, but do not know from which place should I do this.
AJ
|
|
|
|
|
By 'title' do you mean the tab that you click on to select the page?
If so then you can do this from the CPropertySheet class. Use CPropertySheet::GetTabControl() to get a pointer to the tab control, you can then use the CTabCtrl member functions to do what you want, including custom drawing the tabs.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
Thanks a lot!! You made my day!
AJ
|
|
|
|
|
Hi all
Is there any one who knows which dma is assigned to which hardware.
I want to extract the DMA channel for Parallel port.
Best Ragards
Mahdi
|
|
|
|
|
Hi All
i need to call this CoInitializeEx() in my application. compiler giving error msg this
error C2065: 'CoInitializeEx' : undeclared identifier
i have include the respective heaer file "objbase.j"
what i have to do compile ?
thanks
|
|
|
|
|
shadrach_india wrote: i have include the respective heaer file "objbase.j"
I think this is a typo in your post but this is objbase.h
Anyway, post the line of code where you call it, it's probably a typo.
|
|
|
|
|
Inside the a thread
BOOL CClientThread::InitInstance()
{
//CoInitialize(NULL);
CoInitializeEx(NULL,COINIT_MULTITHREADED);
m_TimeLock.Lock();
m_timeLastAction = CTime::GetCurrentTime();
m_TimeLock.Unlock();
// Attach the socket handle to a CSocket object.
// This makes sure that the socket notifications are sent to this thread.
m_ClientSocket.Attach(m_hSocket);
m_ClientSocket.m_pThread = this;
----
----
----
}
|
|
|
|
|
And what is your exact include directive ?
|
|
|
|
|
In Stdafx.h
#define _WIN32_WINNT 0x0400
#define _ATL_FREE_THREADED
#include <objbase.h>
-- modified at 9:48 Monday 6th November, 2006
|
|
|
|
|
|
hi all i had created the SDI application,i named the project "Test3" now in the title bar Test3-unitiled appear i want to change the whole Text to My own suppose "Toolbar 1 " etc how to do that throug the code,so that i can change that dynamically.
Tasleem Arif
|
|
|
|
|
Have a look in the string table resource - that'll contain the application name
|
|
|
|
|
Is AfxGetApp()->GetMainWnd()->SetWindowText("123"); your purpose?
|
|
|
|
|
Thanks it did worked
Tasleem Arif
|
|
|
|