|
Hi all,
i m using progress.when i run my application its display in blue color .
i want when i run application on XP or Vista OS the progress bar looks like xp prgressbar or vista style progress bar.
please help me for this.
thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
"_$h@nky_" wrote: i want when i run application on XP...the progress bar looks like xp prgressbar...
Are you referring to the PBS_SMOOTH style?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
I have a legacy C app which uses FFmpeg APIs.
I'm trying to update it, I want to write a UI in C# and keep the core in C.
So, i'm dabbling in C++/CLI for the first time.
It's my understanding that I can create a managed class wrapper, and have managed methods which take managed parameters, convert them as necessary to unmanaged equivalents (with System.Runtime.InteropServices.Marshal methods), do the work in native C, and then convert outputs from unmanaged to managed types for return.
However, I'm stuck at the start. I've created a class like this:-
ref class FFmpegCap
{
public:
FFmpegCap(String^ inputVideo);
protected:
AVFormatContext *m_pFormatContext;
};
In my constructor, i need to call a C FFmpeg function to initialise the library, one of the parameters it requires is of type AVFormatContext ** . So, I call this function as follows:-
if (av_open_input_file(&m_pFormatContext, pInputVideo ,NULL,0,NULL) != 0)
{
}
However, this fails to compile; error C2664: 'av_open_input_file' : cannot convert parameter 1 from 'cli::interior_ptr<type>' to 'AVFormatContext **'
It seems that the & operator is not doing what I expect of it!
Any pointers?
Thanks
Jon
|
|
|
|
|
There is a C++/CLI forum where you may get faster answers.
Then again, one of the other people here may be typing an answer at the same time as me...
Good luck,
Iain
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
Thanks Iain, I should use my eyes more I think.
|
|
|
|
|
I am using CProperySheet and CPropertyPage in my application for creating tabbed dialog boxes.
For providing the RTL layout, I am using the WS_EX_LAYOUTRTL for Property Sheet and Property Pages both.
This is doing well.
The Titla bar ( System control and min/max/restore buttons) are now in RTL layout.
Tabs contents are also in RTL layout. However two issues are still remaining opened-
1. OK and CANCEL buttons (that were in the Right Side of the screen before applying WS_EX_LAYOUTRTL style) are now in the Middle of the screen. They should be in the Left of the screen.
(Point to notice is that i have hide the "Help" and "Apply" buttons.)
2. Tabs (Tab Bar) are still coming in the Left side of the screen. No effect of the RTL layout on the tabs (Tab Bar) alignment or in their order.
<br />
void CAllControlsSheet::AddControlPages()<br />
{<br />
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);<br />
m_psh.dwFlags |= PSP_USEHICON;<br />
m_psh.hIcon = m_hIcon;<br />
m_psh.dwFlags |= PSH_NOAPPLYNOW;
m_psh.dwFlags |= PSH_RTLREADING ; <br />
m_psh.dwFlags &= ~PSH_HASHELP;
<br />
Invalidate();<br />
<br />
AddPage(&m_treectrlpage);<br />
AddPage(&m_animctrlpage);<br />
AddPage(&m_toolbarpage);<br />
AddPage(&m_datetimepage);<br />
AddPage(&m_monthcalpage);<br />
<br />
}<br />
<br />
BEGIN_MESSAGE_MAP(CAllControlsSheet, CPropertySheet)<br />
ON_WM_QUERYDRAGICON()<br />
ON_WM_SYSCOMMAND()<br />
END_MESSAGE_MAP()<br />
<br />
<br />
BOOL CAllControlsSheet::OnInitDialog()<br />
{<br />
<br />
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);<br />
ASSERT(IDM_ABOUTBOX < 0xF000);<br />
<br />
CMenu* pSysMenu = GetSystemMenu(FALSE);<br />
if (pSysMenu != NULL)<br />
{<br />
CString strAboutMenu;<br />
strAboutMenu.LoadString(IDS_ABOUTBOX);<br />
if (!strAboutMenu.IsEmpty())<br />
{<br />
pSysMenu->AppendMenu(MF_SEPARATOR);<br />
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);<br />
}<br />
}<br />
<br />
SetIcon(m_hIcon, TRUE);<br />
SetIcon(m_hIcon, FALSE);<br />
ModifyStyleEx(0, WS_EX_LAYOUTRTL); <br />
return CPropertySheet::OnInitDialog();<br />
}<br />
<br />
modified on Monday, January 12, 2009 9:45 AM
|
|
|
|
|
I have a word containing umlauts that I need to put on a toolbar button in Word. The project is an ATL/COM addin for MS Word (ANSI build).
The umlauts come out as Cyrillic letters even though our test machine is running a German-localized version of Windows.
This code for example produces correct text in the message box and a Cyrillic letter instead of an umlaut in the Word toolbar:
spButton->PutCaption(L"Öffnen");
::MessageBox(0, "Öffnen", 0, 0);
PutCaption accepts _bstr_t variable as argument, and wants unicode input. And I think that there are two types of umlauts - an ANSI variant which works only if the code page is set to german, and a 16-bit unicode variant, but I'm not sure about that.
And since the cpp file is encoded as ANSI it might be that Word gets an ANSI umlaut when it wants a unicode umlaut.
Is that so or not? And how do I fix the problem in either case?
Thanks.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
modified on Monday, January 12, 2009 10:08 AM
|
|
|
|
|
I don't know if you're right or not - but it sounds plausible.
What you could do is to put the text in a string table, and use LoadString.
This is good practise anyway - it means you can have different language resources, etc. Hard coded strings in your source is a Bad Idea (tm).
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
Hi,
I fixed the problem, and it seems I was right about the Unicode/ANSI umlauts. This code for example didn't produce a MessageBox:
std::wstring unicode = (wchar_t) 0xD6;
unicode += L"ffnen";
if (unicode == L"Öffnen")
::MessageBox(0, 0, 0, 0);
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Hi @ all,
under XP I have the problem sending UDP Packets over the sendto command.
Sporadically my client didn´t send the packets.
The first time it works fine. I build the packet and then send it with the sendto command. On the second time or more the packet will be created and runs the send command correct. The Remote Port and Address are correct too.
But if I protocol these actions with packetyzer or wireshark the sent packet is not displayed anywhere.
Anyone here who knows what it could be that the packet will not send?
Regards,
Karsten
|
|
|
|
|
Check the return value of sendto API
|
|
|
|
|
the return Value is above Zero and the size of command.
|
|
|
|
|
UDP will drop packets if you send them too fast - here's a Microsoft article that says as much[^].
Fundamentally, UDP makes no delivery guarantees, so if that's important to you, you either want to think about using TCP (that'd be my choice) or implementing some form of handshaking.
I would recommend downloading the IBM TCP/IP Redbook[^] - it's a very useful networking resource.
|
|
|
|
|
But under Vista it works correctly.
And I send SIP Packets above the UDP Socket.
I can´t use TCP because it´s a realtime ip phone I programm.
|
|
|
|
|
CrazyDogg wrote: But under Vista it works correctly.
Which means it's likely a coincidence.
CrazyDogg wrote: I can´t use TCP because it´s a realtime ip phone I programm.
Then it'll be up to you to code the handshaking.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
How to code a handshaking for this?
I have never done this.
|
|
|
|
|
CrazyDogg wrote: How to code a handshaking for this?
However you want to. It's just extra information (usually a CRC) that the send adds to the packet at a specific location (e.g., front, back). The receiver looks at that spot to know if all of the packet has been received. If so, an ACK of some sort is sent back.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
I think it is impossible to made a handshake for this because I just code the client.
The server is an asterisk server and I have no rights to change anything.
|
|
|
|
|
In the book, it says:
the socket passed into ConnectEx needs to be previously bound with a call to bind.
Why does a client socket need binding?
|
|
|
|
|
Ummm - because that's the way the API works?
A socket is a communications endpoint - it needs an address (IP address and port number) before it can be used. For a client, the address is 'localhost' (or 127.0.0.1), whilte the port .
The Microsoft samples I've seen use the connect function rather than ConnectEx . connect doesn't require a bound socket - a bind (I would imagine) to an arbitrary port on localhost occurs within connect . ConnectEx gives a significant amount of flexibility in comparison - and (part of) the price for that would appear to be that you have to do the socket binding yourself.
|
|
|
|
|
Im unable to save a image using CImage. Im able to load and draw it. At a later stage, I need to save it to a different path, so I call Save(). It gives an error '80004005' "Unspecified error".
Please suggest..
TIA
|
|
|
|
|
The debugger is your best friend.
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]
|
|
|
|
|
Just now I tried the microsoft's sample. It also gives the same error.. I have nothing to debug. The HRESULT from save is E_FAIL. thats it. the file name is valid. I also tried giving it a simple path name such as "D:\\myImg", but the same error occurs.
TIA
|
|
|
|
|
Does GdiplusStartup succeed?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
Could please post your code?
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]
|
|
|
|