|
jkirkerx wrote: ...but there was no textboxes, I didn't find one.
You have to add them (in the resource editor). Controls don't just automatically appear.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Hello!
I'm trying to insert a bitmap into the game board of tic tac toe.
When the user clicks left mouse button on the board bitmap loads from file and draws itself on the screen.
This is the part of code I want to change. Polje is a vector, a two dimensional field. Velicina is the size of the board(3X3, 6X6, 9X9)
pDC->SetBkColor(color);
for (int i = 0; i < velicina; ++i)
for (int j = 0; j < velicina; ++j)
if(pDoc->polje.at(i).at(j) > 0)
{
pDC->TextOutW(rc.left + j * 50 + 20, rc.top + i * 50 + 20, pDoc->polje.at(i).at(j) == 1 ? _T("X") : _T("O"), 1);
}
Thank you for your help.
|
|
|
|
|
And what is your question?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> If it doesn't matter, it's antimatter.<
|
|
|
|
|
My question is how to insert a bitmap into the game board of tic tac toe from file.
User clicks on the board with the left mouse button and the bitmap shows.
I'm making tic tac toe with bitmaps instead of X or O.
|
|
|
|
|
I guess you will need LoadImage[^] to load the bitmap from file, attach it to a CBitmap[^] object with CBitmap::Attach[^]. Then you can use the good-old CDC::BitBlt[^] to render the bitmap. See the example here[^].
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> If it doesn't matter, it's antimatter.<
|
|
|
|
|
Thank you for your answer.
|
|
|
|
|
How to load an out-of-process control.
I have created EXE com object with a control inside.
I don't know how to load it, CreateControl / AtlAxCreateControlLic etc,
all these functions fail cause they except an in-process control
please help,
Mithrill
|
|
|
|
|
Did you try with CoCreateInstance specifying CLSCTX_LOCAL_SERVER ?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CoCreateInstance will create the object, but when you write
CreateControl you create it inside your application GUI, not just creating a COM object
but all the other UI issues,
When I put the exe com control CLSID inside HTML OBJECT tag it is created inside the page
lake any other ocx dll do when you load it via CreateControl / CreateControlLicEx
Whay is the equivelent CreateControlLic for EXE Controls ??
10x
|
|
|
|
|
Maybe I should write: How to embed out of process com control in c++
like 'AtlAxCreateControlLic' function is doing to in process com controls?
|
|
|
|
|
Hi
I have writen a TAPI program that can call (works fine)
I want to speak via headset not picking up a phone.
I can do this with Venta Fax & Voice program in my PC (so the modem supports this), but my program can not do this (no sounds send/receive).
I have a full-duplex modem.
Is there any tricks in TAPI function for this?
I have used
LINEMEDIAMODE_AUTOMATEDVOICE for
lineOpen function like this:
lineOpen(m_hLineApp, m_nDevID, &m_hLine, dwTAPIVer, 0, 1, LINECALLPRIVILEGE_MONITOR | LINECALLPRIVILEGE_OWNER, LINEMEDIAMODE_AUTOMATEDVOICE, NULL);
I've found that I should use PhoneApp for taking control of mic/speaker, but nothing changed!
int ret = phoneSetHookSwitch(m_hPhone, PHONEHOOKSWITCHDEV_SPEAKER, PHONEHOOKSWITCHMODE_MICSPEAKER);
m_hPhone is a HPHONE object
Regards
www.logicsims.ir
|
|
|
|
|
I am trying to retrieve IE cookie using InternetGetCookie function. Problem is that this function retrieves only first cookie. I want to retrive 2nd cookie set by that website. I tried using InternetGetCookie function twice but still only the first cookie is retrieved. What can be done to retrieve 2nd cookie?
Thanks in advance
|
|
|
|
|
How are you calling InternetGetCookie() ?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
|
Thank you for your reply.
I am able to retrieve the cookie by name. but i am unable to retrieve the cookie marked as secure.
I am getting error code 259.
if anyone knows about retrieving the secure cookie, please let me know.
thanks
avinash
|
|
|
|
|
I got it. secure cookies can be retrieved only when we are making https request.
Now i have another problem. I want to check the expiration date of the cookie retrieved by InternetGetCookieEx().
How to do that?? any idea??
|
|
|
|
|
How can i make sure that i write data on the 1st column of Tag Comments?? Here's is my code:
camPic = Image::FromStream( pStream );
CString str, exifValue;
PropertyItem* propItem = new PropertyItem;
camPic->RemovePropertyItem(PropertyTagExifUserComment);
float temperature, pressure, humidity, wnd_speed, wnd_dir, today_rain;
if ( Global.Working.WeatherStation == true && AccBuff.ReadWeather( it_pic, &temperature, &humidity, &pressure, &wnd_speed, &wnd_dir, &today_rain ))
{
if ( humidity > 101.0 && humidity <= 0.0 )
humidity = 0.00;
exifValue.Format( "ID=%s&scn=%d&img=%d&time=%s&az=%.02f&alt=%.02f&ws=%.02f&wd=%.02f&rnf=%.02f&rni=0&rnd=0&atm=%.02f&temp=%.02f&hum=%.02f",
Global.GenSet.SystemID, Global.Info.nScan, img_number, time.Format( "%d-%m-%Y %H:%M:%S" ) ,
azimuth, altitude, wnd_speed, wnd_dir, today_rain, pressure, temperature, humidity );
}
else
{
exifValue.Format( "ID=%s&scn=%d&img=%d&time=%s&az=%.02f&alt=%.02f&ws=0&wd=0&rnf=0&rni=0&rnd=0&atm=0&temp=0&hum=0",
Global.GenSet.SystemID, Global.Info.nScan, img_number, time.Format( "%d-%m-%Y %H:%M:%S" ) ,
azimuth, altitude );
}
propItem->id = PropertyTagExifUserComment;
propItem->length = exifValue.GetLength(); // includes null terminator
propItem->type = PropertyTagTypeASCII;
propItem->value = exifValue.GetBuffer();
if ( camPic->SetPropertyItem( propItem ) != 0 ){
CString * s1 = new CString("Error setting image exif");
PostMessage( theApp.m_pMainWnd->m_hWnd, UWM_LOG, 1, (LPARAM)(CString *)s1 );
}
Some times it writes the data on the 1st column, and other times on the 2nd one. It's completely random, i just know that this happens because the camera also writes some data on the image. But i clean all the comments before i write something (RemovePropertyItem(PropertyTagExifUserComment). Can someone help me?
Thanks in advance
|
|
|
|
|
Hi,
I need to find out RAM usage and Disk usage of system and I am getting it through API provided by windows.
I have a doubut:
Is there anything like "register for events/notifications from the OS or system" to get values of RAM & Disk usage?
|
|
|
|
|
Hi,
john5632 wrote: Is there anything like "register for events/notifications from the OS or system" to get values of RAM & Disk usage?
In the old days you could use the WM_COMPACTING message[^] to be notified when system memory was low. However for some reason... some might consider this window message obsolete... as its only sent to top level windows.
It may be better to utilize the CreateMemoryResourceNotification function[^] for being notified of a low memory condition.
Hmmm... I can't really think of any callbacks for being notified about disk space. I know that the Performance Data Helper can be used to setup a disk space counter... but that would be pretty much the same as periodically using GetDiskFreeSpace... you would just be allowing PDH to do the work for you. There is also the Win32_PerfFormattedData_PerfDisk_LogicalDisk[^] but again... all this does is read performance monitoring data.
It might be possible to use the EvtSubscribe function[^] to subscribe[^] to a low memory or low disk space event[^]. But why make it so complicated?
None of the 'low disk space' options look very appealing to me personally... I would therefore recommend that you continue to use GetDiskFreeSpaceEx[^] along with a CreateMemoryResourceNotification [^] object.
Best Wishes,
-David Delaune
|
|
|
|
|
Hi David,
Thanks for information. I need to get System Ram Status, drive space status, cpu usage and cpu usage by specific process.
Can all these possible using Notification method. Please also send any link of usage the Notification.
Thanks & Regards,
John
|
|
|
|
|
john5632 wrote: Thanks for information. I need to get System Ram Status, drive space status, cpu usage and cpu usage by specific process.
I'm thinking the performance counters might be what you are after.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
john5632 wrote: Thanks for information. I need to get System Ram Status, drive space status, cpu usage and cpu usage by specific process.
Assuming (from your previous posts) that you already have working code for the 'system RAM status' and 'drive space status'... then it would seem that you now need something for per-process cpu usage:
As I have stated before... (and what David Crow suggests...) is that you could potentially use the PDH Functions to Consume Counter Data[^]
If you are looking for something light-weight... then you could investigate using the GetProcessTimes function[^].
The lpKernelTime and lpUserTime from GetProcessTimes[^] can be used to calculate cpu usage for an individual process.
At a lower level I believe what GetProcessTimes is doing internally is calling NtQuerySystemInformation[^] with the SystemProcessInformation index and returning the times stored within the SYSTEM_PROCESS_INFORMATION structure[^] associated with the process.
Best Wishes,
-David Delaune
|
|
|
|
|
Can I use CreateMemoryResourceNotification for user defined memory size, if yes please let me know how to do?
|
|
|
|
|
john5632 wrote: Can I use CreateMemoryResourceNotification for user defined memory size, if yes please let me know how to do?
No, you cannot. The function is designed to notify an application of a low physical memory condition.
|
|
|
|
|
Thanks for your reply....
Can you suggest any way to get Network Utilization such like as Task Manager...?
|
|
|
|