|
jaafar tribak wrote: First of all, I would like to apologize for posting this question in the C++ forum as it deals with Classic VB (VBA) ... The reason I posted here is because I can't get an answer (not even a hint) in the VB/VBA foums ... I searched the web extensively but without any luck I do not see where you've asked this question in the VB forum.
"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
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Hi,
I did ask similar questions in the VB and COM forums before and in other websites as well .. but these rather difficult questions often remain ignored or without a propper solution .. I thought VC programmers were more confortable with these type of in depth subjects.
The very few vb lines in the above code snippet should be easy to understand by non vb programmers .. I hope that anyone fmiliar with ole/com would hopefully be able to give me (at least) a rough hint
Regards.
|
|
|
|
|
I am starting my application by a Service. Now When I want to save a
file, I tried using CFileDialog. but when ever I select "desktop" it
prompts a message as "C:Windows\system32\config\systemprofile\desktop"
refers to location that iss unavailable. It could be hard drive on this
computer, or on a network... "
I checked that "C:Windows\system32\config\systemprofile" is available
but there is not desktop directory inside it.
|
|
|
|
|
|
Sorry I didnt knw abt this
|
|
|
|
|
|
|
Hi,
I'm integrating some some WPF controls into a MFC dialog box.
One of the control is a media player that shows live video.
The second one is a label that shows the current video time.
What I need is to have is the label on top of the media player. The label should only display the time, so its background needs to be transparent.
Right now, I have the video player running fine inside the dialog box, but I am unable to have the time displayed as I wish. It just overlap the video player.
Both WPF components were creating by following instructions from this link.
https://msdn.microsoft.com/en-us/library/ms742522(v=vs.110).aspx#hosting_a_wpf_page[^]
I try to set the label with a transparent background.
timeLabel->Background = gcnew System::Windows::Media::SolidColorBrush (System::Windows::Media::Colors::Transparent);
But the label background is shown black.
I also try to set the Transparent flag of the MFC CDialog to true, but it didn't have any effect.
How can I that fixed?
Do I need to set up something special when I instantiate the WPF controls?
Do I need to call some functions from inside the MFC dialog box?
Thanks,
Alain Migeon
|
|
|
|
|
Member 8833981 wrote: I try to set the label with a transparent background.
timeLabel->Background = gcnew System::Windows::Media::SolidColorBrushSystem::Windows::Media::Colors::Transparent); This looks like Managed code. Might try the other forum.
"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
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Thanks for suggestion.
I have just done so. But I'm not sure that the answer to my problem is inside the WPF part.
It can also be in the MFC one.
|
|
|
|
|
Hi,
I want to download file from a given URL. I am using URLDownloadToFile() function for this purpose, but I am not getting the actual file. When I try to run the file, it throws an error.
As an example, If I download MSVS 2010 service pack 1 from Microsoft's website, the file size will be 795KB. But if I download using URLDownloadToFile() function passing the url and file name, downloaded file size will be 99 KB.
Is there any method to download an exe from a URL in C++.
Any help wll be appreciated.
Regards,
mbatra
|
|
|
|
|
Which URL?
You must pass the complete URL to the file. When browsing MS for downloads, they are often provided by a confirmation page that will start the download. If you pass that URL, wou will download the web page content. On such pages you will usually find a link to the real file if the download does not start after some time.
|
|
|
|
|
Hi Jochen,
Thanks for your response. I got the code working. I was passing the link of the confirmation page, that was the issue.
Thanks..!!
Regards,
|
|
|
|
|
mbatra31 wrote: I want to download file from a given URL. I am using URLDownloadToFile() function... How is it being used?
"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
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Hi Guys!,
I've been trying to make a simple tracking game but I'm having trouble just setting up the basic game states. I'm hoping to use a finite state machine(FSM) to switch between screens but every article iv read about them is different and sometimes they leave out details, I couldn't understand it properly.
For example if I've two screens , Menu and Game screen. And in game I've to implement states for a simple tracking game. What would be a FSM look like to switch between them.??
|
|
|
|
|
Member 9350237 wrote: I'm hoping to use a finite state machine(FSM) to switch between screens... What are the game's states? Inputs?
"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
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Quote: but every article iv read about them is different and sometimes they leave out details, I couldn't understand it properly.
They are different because FSM are widely used, for different purposes.
There are not may details to understand. A finite state machine is a rather simple stuff. You should understand your scenarion, though.
By wild guess, you could do something like (or go with a more OO approach)
struct FSMData
{
FSMState state;
};
void update_fsm(FSMData & fsmd)
{
switch(fsmd.state)
{
case STATE_MENU:
handle_menu(fsmd);
break;
case STATE_GAME:
handle_game(fsmd);
}
void handle_menu(FSMData & fsmd)
{
if ( userSelection() == PLAY_GAME)
{
fsmd.state = STATE_GAME;
return;
}
}
void handle_game(FSMData & fsmd)
{
if (userInput() == QUIT_GAME)
{
fsmd.state = STATE_MENU;
return;
}
}
|
|
|
|
|
Message Closed
modified 13-Apr-15 6:10am.
|
|
|
|
|
CPallini has given you a basic example for a FSM - you will understand that we're not here to provide ready solutions. You have formulated your game states - what stops you from extending that sample with that, or, at least trying?
|
|
|
|
|
Hi
I am getting a number of errors in MFC functions (Using Visual Studio 2012)
can't convert const char [xx] to LPCTSTR when using a literal with " double qoute it
was my understanding that anything with " was a pointer now weather its char * or
LPCTSTR is a different issue however it shouldn't be of type const char[xx]
Thanks
|
|
|
|
|
Do you have the project set to use the Unicode character set? If so LPCTSTR is equivalent to LPCWSTR , so you cannot convert a char pointer to it.
|
|
|
|
|
Richard
you did it again !!!!!
|
|
|
|
|
Thanks. Sadly my flashes of brilliant intuition are getting fewer and further apart these days.
|
|
|
|
|
Try using TCHAR instead of char , and wrapping string literals in the _T() macro.
"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
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|