|
Hello Jose,
First of all, thanks for the reply.
I forgot to mention in the original post that the code for the single-line, text-only ticker is written in VB and that I would very much prefer if the code for the new multi-line, text and image ticker was written in c++. This means that I can probably and would rather not reuse the old code.
As far as if there is anything in particular, sort of. Before, I was using a static label and scrolling it. However, with multiple lines, should I use a read-only multi-line text area or several static labels? And also, since I may have several "messages" (items with nested text), I would need several text areas, or image controls for the images. How do I make all of these areas scroll unanimously? Can I embbed them in another layer and make that layer scroll?
I hope my response was not too confusing.
Thanks a lot,
-----------------
Genaro
\\\|
_ _
@ @
_\\
--|
_/
|
|
|
|
|
I want to create a dialog that is a child of another dialog. This child dialog would have a title bar so I can move it around, but as a child it would be confined (cliped) within it's parent dialog.
I already tried the obvious way. Create a dialog, set type as Child, then create an object for this dialog and call the create method.
ex:
void CParentDialog::CreateChildDialog()
{
m_ChildDialog.Create( IDD_CHILD, this );
}
What happens is that the dialog is there, but it is being drawn over by other controls in the parent dialog, and also I cannot click on it to activate it or move it around.
Louis.
|
|
|
|
|
ok, i figured out all the settings to achieve what I want...
Basically, what was important, is that I had to set the WS_CLIPSIBLINGS window style to all child of the parent dialog.
case closed.
|
|
|
|
|
When the messagebox "Server busy" pops up from an autmation server what exactly does that mean? Busy in that it's processing something, busy in that it is in my event sink waiting to return or something else that I'm not aware of?
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
I think it means "busy in that it's processing something". It may appear with slow loading servers (MSWord for instance). It may also appear if the server has activated a modal dialog, and of course if the server is executing a long operation.
With MFC, it seems like there are some ways to control how / when / if these dialogs appear, although I've never used them so I'm not entirely sure. Take a look at AfxGetOleMessageFilter[^] and the COleMessageFilter Class[^].
If you aren't using MFC, take a look at CoRegisterMessageFilter[^] and IMessageFilter[^]. You would need to create a class that implements IMessageFilter , but that's exactly what MFC's COleMessageFilter does and its source may serve as a guide on how to do it.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Is it possible to load a dll in an ActiveX control? I have tried implicitly and explicitly loading the dll and I have problems either way. When implicitly loading, the container project fails when loading the control saying...
CoCreateInstance of OLE control {8601721E-DF2A-4DA8-816D-ACB2FEB9E287} failed.
>>> Result code: 0x80040154
>>> Is the control is properly registered?
The control is properly registered though. When I try to load the dll explicitly, the LoadLibrary call always returns NULL and the GetLastError says it can't find the library. The dll is in the correct location. Is this all because you can't load a dll from an ActiveX control, or am I missing something. Thank you in advance.
|
|
|
|
|
mrothermund wrote:
Is it possible to load a dll in an ActiveX control?
As far as I know, being an ActiveX control or not shouldn't make a difference when loading other dlls...
mrothermund wrote:
CoCreateInstance of OLE control {8601721E-DF2A-4DA8-816D-ACB2FEB9E287} failed.
>>> Result code: 0x80040154
>>> Is the control is properly registered?
I've seen reports of this error appearing after upgrading to XP with SP2. ISTM some mention to msxml.dll too...
Have you tried loading the dll from another dll/exe (not the ActiveX)? Have you tried running the Depends utility?
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
When I execute the following code in my program, it works fine when I toggle the buttons that I generated. However, if I go into IE and manually set the proxy via Tools -> Internet Options -> Connections -> Lan Settings -> Check/Uncheck "Use a Proxy setting...", it works the first time and runs the correct method, so if I check the box and turn the proxy server on and click Ok it will run the ProxyOn() method. However if I don't compeletly close out Internet Options and and go back into Lan Settings and uncheck the box and click OK, it will run the ProxyOn() method again. Now the really confusing part is the fact that if I do it a third time or more, it won't double run the methods but it will be one off from what it should be running. I know its alot to digest but does anybody have any ideas. So here I have the thread that I create to watch for a change in the proxy setting.
hThread = CreateThread (NULL, 0, (unsigned long (__stdcall *)(void *))this->ThreadFunc, (void *)(this), 0, &this->hThreadId);
DWORD WINAPI CMFToolbar::ThreadFunc(LPVOID lParam)
{
CMFToolbar *toolbar = (CMFToolbar*)lParam;
while(1){toolbar ->WINAPI_tWinMain();};
}
int CMFToolbar::WINAPI_tWinMain()
{
LONG l = 0L;
HKEY hKey = {0};
//Open Registry Key to watch
l = RegOpenKeyEx (
HKEY_CURRENT_USER,
_T("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"),
0,
KEY_NOTIFY,
&hKey );
if(l == ERROR_SUCCESS)
{
// The following call will wait until a change is made to the registry key.
l = RegNotifyChangeKeyValue (
hKey,
FALSE,
REG_NOTIFY_CHANGE_LAST_SET,
NULL,
FALSE );
RegCloseKey(hKey);
//Determines whether or not Proxy is enabled and executes proper method
DWORD flag = 0;
if ( InternetGetConnectedState ( &flag, 0 ) )
{
if ( flag & INTERNET_CONNECTION_PROXY )
{
fout<<"Proxy Off Method"<
|
|
|
|
|
Have you tried reading the "ProxyEnabled" (I guess that's the one) value in the key you are monitoring instead of using InternetGetConnectedState?
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Jose Lamas Rios wrote:
Have you tried reading the "ProxyEnabled" (I guess that's the one) value in the key you are monitoring instead of using InternetGetConnectedState?
I was also wondering why the code I posted before was acting that way. I'm just assuming I'm not seeing the problem because I put it together.
|
|
|
|
|
Matthew Devine wrote:
I was also wondering why the code I posted before was acting that way
Yeah, me too
Matthew Devine wrote:
I'm just assuming I'm not seeing the problem because I put it together.
Well, I couldn't find anything obviously wrong in your code either, but that doesn't mean a lot, since I have no experience with that kind of things. The only thing I noted is that there is a possibility that if a change is made between your call to InternetGetConnectedState and the call to RegNotifyChangeKeyValue in the next iteration, you would lose a notification. However, that's a very tiny fraction of time, and it doesn't seem possible to be caught in that situation doing changes through IE's dialogs. Furthermore, it wouldn't explain what you describe (InternetGetConnectedState returning out-of-date results)...
I think the actual problem may be related to InternetGetConnectedState not taking its results directly from the registry. If the state is also stored in some other place, maybe your query is being done after the registry was modified but before this other state is actually updated. That's why I suggested reading the registry; reading the values from the same place about which you get notifications seem to make more sense. Does it work?
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Well I'm having some trouble checking the registry key setting for "ProxyEnable", I can't seem to get it to work. I'm also not to sure about getting a DWORD value from the registry, but I'll let you know if I figure it out.
|
|
|
|
|
I want to detect when a user closes a window by clicking on the X in the title bar. I dont know how to create a message map to catch the event. When I close the Window, I want to delete the CWnd object associated with that Window.
Thanks.
Jerry
|
|
|
|
|
Handle WM_SYSCOMMAND , specifically the SC_CLOSE case.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
jerry1211a wrote:
I want to detect when a user closes a window by clicking on the X in the title bar.
Handle the WM_CLOSE message (CWnd::OnClose() ).
jerry1211a wrote:
When I close the Window, I want to delete the CWnd object associated with that Window.
If you are doing this from the window that is being closed, then the proper place to do it is in the PostNcDestroy() function
void CMyWindow::PostNcDestroy()
{
delete this;
}
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
Hi
Anyone knows that there is such tranlation tool exists or not. This translation tool can read a exe file's resource text and write back the translted text to the exe file.
Thanks,
|
|
|
|
|
Resource translation is big business - I doubt you'll find a robust mechanical solution. That being said, check out the translator example in this[^] article.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
the question is about a poker game.....i need to finish the check function to check whether it won or not!!!! the question is ....have to draw 5 cards and check win or not!... need help
Winning Conditions
// To be implemented in check_winnings
Combination Winnings Winning Status
Nothing 0 0
3 of a kind Bet * 5 100
4 of a kind Bet * 10 200
BONUS : Each 2 of a kind Bet * 8 300
BONUS : Straight Bet * 50 400
BONUS : Flush Bet * 100 500
BONUS : Royal Straight Flush Bet * 500 600
|
|
|
|
|
koalacui wrote:
i need to finish the check function...
Which implies that you have started it but have run into a snag. What exactly is troubling you? The more specific you are, the more help you'll potentially receive.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
more details:
/* Sample Output 1////////////////////////////////////////////////
========================================
Your current balance is $100 dollars.
========================================
Please enter the amount to bid: 150
ALERT! You do not have enough to bet $150.
Please enter the amount to bid: 90
========================================
Your current balance is $10 dollars.
========================================
Please [ENTER] to draw your first card …
-- Your Cards on hand ------------------
- A of Spades
----------------------------------------
Please [ENTER] to draw your second card …
-- Your Cards on hand ------------------
- A of Spades (61)
- 10 of Spades (70)
----------------------------------------
Please [ENTER] to draw your third card …
-- Your Cards on hand ------------------
- A of Spades (61)
- 10 of Spades (70)
- K of Spades (73)
----------------------------------------
Please [ENTER] to draw your forth card …
-- Your Cards on hand ------------------
- A of Spades (61)
- 10 of Spades (70)
- K of Spades (73)
- J of Spades (71)
----------------------------------------
Please [ENTER] to draw your last card …
-- Your Cards on hand ------------------
- A of Spades (61)
- 10 of Spades (70)
- K of Spades (73)
- J of Spades (71)
- Q of Spades (72)
----------------------------------------
== Winning Result ======================
Congratulation, you have a Royal Flush!!
You have won $2000 dollars.
========================================
|
|
|
|
|
#include <iostream>
#include <stdlib.h>
#include <string>
#include <time.h>
#include <conio.h>
using namespace std;
void print_balance( int ) ;
void print_result( int ) ;
void Print_Cards_At_Hand ( void ) ;
void Check_Winning ( void ) ;
int draw_Card( void ) ;
int deck[52] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73 } ;
void main( void )
{
srand (time (0));
int balance = 100 ;
int bet = 0 ;
while( balance > 0 )
{
balance = balance - bet;
print_balance( balance ) ;
cout << endl ;
if (balance != 0)
{
do
{
cout << "Please enter the amount to bid: $" ;
cin >> bet ;
if( bet > balance )
{
cout << "ALERT! You do not have enough " << "to bet $" << bet << endl ;
}
cout << endl ;
}while( bet > balance || bet == 0) ;
Print_Cards_At_Hand();
cout << endl ;
}
}
} // main()
void print_balance( int balance )
{
cout << "========================================" << endl;
cout << "Your current balance is $" << balance << " dollars" ;
cout << endl ;
if( balance <= 0 )
{
cout << "You are bankrupted" ;
cout << endl;
}
cout << "========================================" << endl;
}
void print_result( int winning_amt )
{
cout << "== Winning Result ======================" << endl;
if( winning_amt > 0 )
{
cout << "You have won " << winning_amt << "dollars."
<< endl ;
}
else
{
cout << "Sorry, you have not won anything." << endl ;
cout << "You have lost $" << winning_amt << " dollars." ;
}
cout << "========================================" << endl;
}
int draw_Card( void )
{
int c = (rand() % 52) ;
return c;
}
void Print_Cards_At_Hand ( void )
{
int i;
int x;
int y;
int number[6];
int identity[6];
int value[6];
string type;
for (i=1;i<6;i++)
{
cout << "Press [ENTER] to draw your " << i << " card ... " << endl;
while (_getch() !=13)
{}
cout << "-- Your Cards on hand ------------------" << endl;
int card_index = draw_Card();
y = deck[card_index]/20;
if( y == 0 )
{
identity[i] = 1;
value[i] = deck[card_index];
number[i] = deck[card_index];
}
else if( y == 1 )
{
identity[i] = 2;
value[i] = deck[card_index];
number[i] = deck[card_index] - 20;
}
else if( y == 2 )
{
identity[i] = 3;
value[i] = deck[card_index];
number[i] = deck[card_index] - 40;
}
else
{
identity[i] = 4;
value[i] = deck[card_index];
number[i] = deck[card_index] - 60;
}
for (x=1;x<=i;x++)
{
if ( identity[x] == 1 )
{
cout << "- " << number[x] << " of Diamonds" << " ("<< value[x] << ")"<< endl;
}
else if ( identity[x] == 2 )
{
cout << "- " << number[x] << " of Clubs" << " ("<< value[x] << ")"<< endl;
}
else if ( identity[x] == 3 )
{
cout << "- " << number[x] << " of Hearts" << " ("<< value[x] << ")"<< endl;
}
else
{
cout << "- " << number[x] << " of Spades" << " ("<< value[x] << ")"<< endl;
}
}
}
}
void Check_Winning ( void )
{
}
|
|
|
|
|
How to get last access time of some directory?
On files, I use GetFileTime() function and it is
working property, but on folder, it returns null.
Thanks in advanvce.
|
|
|
|
|
MirkoMax wrote:
...but on folder, it returns null.
And what does GetLastError() return?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I am a beginner in the windows programming world, and am having a bit of trouble figuring out how to determine the state of my checkbox when it's ownerdraw.
If I use BM_GETCHECK it always returns 0, even if I send BM_SETCHECK a line above passing BST_CHECKED. I also tried ORing BS_CHECKBOX and/or BS_AUTOCHECKBOX with BS_OWNERDRAW but BM_GETCHECK still returned 0.
I then attempted to use BM_SETIMAGE as general storage (a pointer) but BM_GETIMAGE always returns 0 as well.
Is it due to the fact my checkboxes are ownerdraw, or is there some other problem I'm unaware of?
thanks
|
|
|
|
|
May we see a code snippet?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|