|
I tried, without success , I also tried modifying the other params and creating the DIB with a negative height, but so far nothing has worked.
Here is the function call.
SIZE size = { _x2 - _x1, _y2 - _y1 };
POINT SrcOrigin = {0,0};
::SetDIBitsToDevice(
hdc,
_x1, _y1,
size.cx, size.cy,
SrcOrigin.x, SrcOrigin.y,
SrcOrigin.y, size.cy - SrcOrigin.y,
m_ppvBits, m_DIBinfo,
m_iColorDataType );
If I swap the commented line, it works fine, but it draws the full sized bitmap which is not what I want.
|
|
|
|
|
No matter, I managed to get it working correctly.
SIZE size = GetSize();
POINT SrcOrigin = {0,size.cy - (_y2-_y1) };
::SetDIBitsToDevice(
hdc,
_x1, _y1,
_x2-_x1, _y2-_y1,
SrcOrigin.x, SrcOrigin.y,
0, size.cy,
m_ppvBits, m_DIBinfo,
m_iColorDataType );
seems I had some of the paramaters a little messed up.
|
|
|
|
|
now i am able to execute a exe at scheduled time.
but i have to call a function at scheduled time.
suppose a service starts and at scheduled time, can i call a function of that service which is allready running by using task scheduler.
if any have idea please share with me.
thanks & regards
bankey
|
|
|
|
|
It sounds like you want two exes
A) Your service
B) A helper app that sends a message to (A) and tells it to perform its function
The two can talk using inter process communication[^]
|
|
|
|
|
Banks K wrote: but i have to call a function at scheduled time.
Set up a timer via SetTimer() . As each WM_TIMER message is received, check the current time with the scheduled time. If they match, call the function.
Banks K wrote: ...can i call a function of that service which is allready running by using task scheduler.
No.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Banks K wrote: at scheduled time, can i call a function of that service which is allready running by using task scheduler.
I don't understand. A "service which is allready running" would be a process. One process cannot "call functions" in another process. Please be specific when asking questions so we have any clue how to answer.
led mike
|
|
|
|
|
Banks K wrote: suppose a service starts and at scheduled time, can i call a function of that service which is allready running
For this you need to have interfaces exposed on that service.
Banks K wrote: by using task scheduler.
AFIK, taskscheduled runs only executables at scheduled time. You can access interfaces exposed by service in an executables, call required functions and schedule that exe using task schedular.
|
|
|
|
|
If the service can know when to execute the function, then look into using:
The SetWaitableTimer function activates the specified waitable timer. When the due time arrives, the timer is signaled and the thread that set the timer calls the optional completion routine.
Any sufficiently gross incompetence is nearly indistinguishable from malice.
|
|
|
|
|
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.
|
|
|
|