|
I want to group a collection of textboxes, labels and buttons, and store it as a single object that I can make visible or invisible.
I was just thinking maybe a plain CreateWindow could do the job, but for now, I'm not sure if it's possible to do, and the name it would be refereed to as - nomenclature.
|
|
|
|
|
Hey Jim,
jkirkerx wrote: I want to group a collection of textboxes, labels and buttons, and store it as a single object that I can make visible or invisible.
I am sure that you are already familiar with the parent/child relationship with windows; If you hide a parent window all of its children are non-visible.
Intentional paronomasia: Thinking outside the box... In your InitDialog() or perhaps OnSize() you could get the rectangle of the group box and set all windows with the Top/Left point that are within the group box rect... to be child windows of the group box. Now when you hide the groupbox... all child windows will also be hidden.
It may also be be possible to do something with ON_CONTROL_RANGE[^] to control/hide all of them at once. All you need to do to implement this is give them ID's of a contiguous range... 100, 101, 102, 103, 104, ...
That's all I can think of for now.
Best Wishes,
-David Delaune
|
|
|
|
|
Thanks Dave.
I already wrote code for the form, in which I used CreateWindow to make a series of Labels and a Textboxs to create a form, and I just wanted to use the same code over again.
I found the textbox in the dialog form editor toolbox, and created the same form again in dialog format as well. What a pain, it was easier to just write code instead of using the gui.
I'll experiment with the window you suggested and the dialog form and see which one I like better.
I've been in the web world for a long time, and could not phrase what I was looking for.
|
|
|
|
|
Hey Jim,
jkirkerx wrote: I already wrote code for the form, in which I used CreateWindow to make a series of Labels and a Textboxs to create a form, and I just wanted to use the same code over again.
Actually... if you are dynamically creating those controls... its even easier... the CreateWindow function[^] will allow you to set the hWndParent . All you would need to do is set the parent to the groupbox handle.jkirkerx wrote: I've been in the web world for a long time, and could not phrase what I was looking for.
Yep, no problem; we all have areas of expertise and other subjects where we get a little lost.
Best Wishes,
-David Delaune
|
|
|
|
|
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
|
|
|
|