|
I do not think that the exception will cross threads. I would suggest using a Win32 Event object, because it can be seen by multiple threads, and signal it in one thread to indicate the other to stop processing.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
chilituna wrote: I thought it would be nice to have one dialog
where is stop button, and it stops whatever the
main thread is doing..
Is the dialog modal?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
chilituna wrote:
Can I raise Exception in one thread and handle it in another?
No, the handler has to be somewhere in the throwing thread's call stack.
|
|
|
|
|
Hi, again a question about me with my IOCP skills
ok, the situation is the following, everything works perfectly except for 1 thing, a really weird thing if you ask me.
I'm currently testing so i use 1 WorkerThread with 1 udp virtual connection at the time.
When i do a WSARecvFrom, i should recieve a buffer with a size of lets say 600 bytes. This hapends idd but later, here is my thing:
GetQueuedCompletionStatus(...)<br />
DWORD ioSize = 0;<br />
case RequestSend:<br />
break;<br />
case AfterSend:<br />
ioSize = static_cast<DWORD>(lpOverlapped->InternalHigh);<br />
break;<br />
case AfterRecieve:<br />
ioSize = static_cast<DWORD>(lpOverlapped->InternalHigh);<br />
This is the things i do, now it happends that in AfterRecieve, ioSize is the same as the size when i sended. better said, the data aint recieved yet, however i do get a notification that the data is recieved. When i put a breakpoint at that point, i see that the data is deliverd, to pull a conclusion, I get a notification when the data is recieved well it isnt untill i put a breakpoint at that place, really weird
weird story so:
dwIoSize = static_cast<DWORD>(ptrOverlapped->InternalHigh);<br />
ptrSession->incRecvBytes(dwIoSize);<br />
if ((iTemp = ptrGameClass->UnpackServerInfo(ptrSession->getNDServer(), &objToolset)) == 0){
pThis->FinishGame(ptrSession->getNDServer());<br />
__REPORT("SUCCEEDED");<br />
}<br />
else if (iTemp < 0){<br />
__REPORT("%s->UnpackServerInfo() failed", ptrGameClass->Gamename());<br />
}
To make it even more clear, whenever i put a breakpoint at: ptrSession->incRecvBytes(dwIoSize);, dwIoSize is 8 as the send buffer, but ptrOverlapped->InternalHigh is like 600 bytes.
When i do reports, it just reports that ptrOverlapped->InternalHigh is 8
|
|
|
|
|
|
Hi,
I want to use the Code Snippets in Visual C++ VS2005 Professional.
But it seems it's not exist here.
When I go menu Tools\Code Snippets Manager I can not select a C++ from the "Language" combo box.
Is there some way to activate the Code Snippets stuff in C++, or it's available in another editions of Visual Studio 2005(for example VS2005 Developer Edition)?
Thanks.
|
|
|
|
|
Code snippets don't exist in C++, apparently, we're too smart to need them
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Ha!
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Christian Graus wrote: Code snippets don't exist in C++,
Yea they do, I downloaded it but still haven't gotten around to installing See > Microsoft Visual Studio 2005 IDE Enhancements[^]
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
oleg63 wrote: Code Snippets in Visual C++ VS2005
C++ was not included as part of the original snippet functionality. They did add it in later via a power toy. See Microsoft Visual Studio 2005 IDE Enhancements[^]
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
Hi
I have built an app using the TransparentButtonDemo and Video Manipulation demos i have found on here. The video is using vmr9 and the relevant video is loaded and starts playing dependant on the button pressed on my dialog.
It is going to be necessary to have some information overlayed on the video while it is playing but any dialog items i add render behind the video. Is there an easy way to get a couple of mfc components to render on top of the video?
Thanks in advance guys
Dave
|
|
|
|
|
Not without flicker. Every time a new frame is drawn it will be on top.
The video mixing renderer, as its name implies, is made for mixing video. You can alpha-blend
any bitmap onto the video stream. I suppose you could draw dialog items to a bitmap and mix them
with the video but I'm not sure how the user interface would work.
An easier method would be (IMO) to write your own renderer so you can control the rendering of
frames. You could use clipping regions or whatever to allow underlying items to show through.
Mark
|
|
|
|
|
Hi Friends,
In my application, I created no of static label at run time and it derived from CStatic class. That static window placed by SetWindowPos function.
example:
m_Label.SetWindowPos( pWnd->wndTOp, CRect ( 10,10,50,50),SWP_SHOWWINDOW);
The first parameter used to set the window zorder . Am I correct?
At run time, How can the user select pariticular control when they are overlapped?
Like,In MS word document, The user can draw no of rectangle box and overlapped between them. The user can able to select the top most window or the tracker enable window.
In my application, I am using CRectTracker class. It used to track the static label.How can i select tracker enabled label or top of the label when they are overlapped?
Thanks and Regards,
<b></b>
Vichu
|
|
|
|
|
Vishvanathan wrote: The first parameter used to set the window zorder . Am I correct?
Nope. The first parameter is the handle of the window, after which you will insert your window). The last parameter is the new z-order.
Have a look at this article[^] for the rest of your question.
|
|
|
|
|
The OP seems to be calling the CWnd version of the function, in which the first parameter is the window to to insert after in the Z-Order.
Neither the CWnd or Win32 version of the function takes an HWND as the last parameter, although the last parameter (flags) indicates how to treat that parameter.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Vishvanathan wrote: The first parameter used to set the window zorder . Am I correct?
Yes, but the last parameter tells the function how it should treat the Z-Order parameter.
I believe that the functionality of object selection in applications like Word and Visio is implemented by the application itself. There is nothing that I know of built into Win32 to give you that kind of "design-space" functionality.
You will have to track where the user is clicking the mouse, and see what object(s) are under that point, and then select a particular control depending on what the user is trying to do. For example, are they trying to select an item, select an additional item to add it to a group selection, or remove an item from a group selection, and then you will be able to extend your selection rectangle (or multiple ones) around the objects involved.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Greetings everyone, I need to connect a visual embedded c++ application to a sql2000 database over a wifi connnection. I am rather new in the c++ development, so please bear with me.
And as far as i got, i'm struggling to import the msado15.dll file to my application. As i think i should as far as the examples go.
But at compile time i get a whole lot of errors because of msado15.dll
In which file should i actually import the dll?
And is it with the
#import "msado15.dll" rename("EOF", "adoEOF")
string?
Thanks in advance.
|
|
|
|
|
XTr1NiTy wrote: But at compile time i get a whole lot of errors...
Don't be stingy! Share those errors with us.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
You better include the (full) path, so the compiler finds the dll.
You better include the typical errors, often helps reading and understanding the error messages. Most the are right.
Greetings from Germany
|
|
|
|
|
Thank for the quick reply guys the errors are :
I will try the full path quickly maybe it will help
--------------------Configuration: iDL_Scan - Win32 (WCE ARMV4I) Debug--------------------
Compiling resources...
Compiling...
StdAfx.cpp
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(409) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(791) : error C2146: syntax error : missing ';' before identifier '_NewEnum'
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(791) : error C2501: 'IUnknownPtr' : missing storage-class or type specifiers
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(1582) : error C2146: syntax error : missing ';' before identifier 'DataSource'
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(1582) : error C2501: 'IUnknownPtr' : missing storage-class or type specifiers
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(1582) : error C2501: 'DataSource' : missing storage-class or type specifiers
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(1584) : error C2146: syntax error : missing ';' before identifier 'ActiveCommand'
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(1584) : error C2501: 'IDispatchPtr' : missing storage-class or type specifiers
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(1584) : error C2501: 'ActiveCommand' : missing storage-class or type specifiers
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(1595) : error C2146: syntax error : missing ';' before identifier 'GetDataSource'
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(1595) : error C2501: 'IUnknownPtr' : missing storage-class or type specifiers
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(1601) : error C2146: syntax error : missing ';' before identifier 'GetActiveCommand'
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(1601) : error C2501: 'IDispatchPtr' : missing storage-class or type specifiers
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(1834) : error C2146: syntax error : missing ';' before identifier 'DataFormat'
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(1834) : error C2501: 'IUnknownPtr' : missing storage-class or type specifiers
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(1834) : error C2501: 'DataFormat' : missing storage-class or type specifiers
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(1856) : error C2146: syntax error : missing ';' before identifier 'GetDataFormat'
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(1856) : error C2501: 'IUnknownPtr' : missing storage-class or type specifiers
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(2488) : error C2146: syntax error : missing ';' before identifier 'DSO'
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(2488) : error C2501: 'IUnknownPtr' : missing storage-class or type specifiers
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(2488) : error C2501: 'DSO' : missing storage-class or type specifiers
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(2490) : error C2146: syntax error : missing ';' before identifier 'Session'
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(2490) : error C2501: 'IUnknownPtr' : missing storage-class or type specifiers
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(2490) : error C2501: 'Session' : missing storage-class or type specifiers
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(2496) : error C2146: syntax error : missing ';' before identifier 'GetDSO'
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(2496) : error C2501: 'IUnknownPtr' : missing storage-class or type specifiers
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(2497) : error C2146: syntax error : missing ';' before identifier 'GetSession'
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(2497) : error C2501: 'IUnknownPtr' : missing storage-class or type specifiers
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(2806) : error C2146: syntax error : missing ';' before identifier 'Row'
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(2806) : error C2501: 'IUnknownPtr' : missing storage-class or type specifiers
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(2806) : error C2501: 'Row' : missing storage-class or type specifiers
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(2808) : error C2146: syntax error : missing ';' before identifier 'ParentRow'
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(2808) : error C2501: 'IUnknownPtr' : missing storage-class or type specifiers
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(2808) : error C2501: 'ParentRow' : missing storage-class or type specifiers
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(2814) : error C2146: syntax error : missing ';' before identifier 'GetRow'
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(2814) : error C2501: 'IUnknownPtr' : missing storage-class or type specifiers
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(2840) : error C2146: syntax error : missing ';' before identifier 'Stream'
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(2840) : error C2501: 'IUnknownPtr' : missing storage-class or type specifiers
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(2840) : error C2208: 'struct ADODB::Stream' : no members defined using this type
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(2846) : error C2146: syntax error : missing ';' before identifier 'GetStream'
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(2846) : error C2501: 'IUnknownPtr' : missing storage-class or type specifiers
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(2868) : error C2146: syntax error : missing ';' before identifier 'OLEDBCommand'
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(2868) : error C2501: 'IUnknownPtr' : missing storage-class or type specifiers
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(2868) : error C2501: 'OLEDBCommand' : missing storage-class or type specifiers
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(2874) : error C2146: syntax error : missing ';' before identifier 'GetOLEDBCommand'
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(2874) : error C2501: 'IUnknownPtr' : missing storage-class or type specifiers
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(2905) : error C2146: syntax error : missing ';' before identifier 'Rowset'
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(2905) : error C2501: 'IUnknownPtr' : missing storage-class or type specifiers
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(2905) : error C2501: 'Rowset' : missing storage-class or type specifiers
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(2909) : error C2146: syntax error : missing ';' before identifier 'RowPosition'
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(2909) : error C2501: 'IUnknownPtr' : missing storage-class or type specifiers
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(2909) : error C2501: 'RowPosition' : missing storage-class or type specifiers
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(2915) : error C2146: syntax error : missing ';' before identifier 'GetRowset'
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(2915) : error C2501: 'IUnknownPtr' : missing storage-class or type specifiers
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(2921) : error C2146: syntax error : missing ';' before identifier 'GetRowPosition'
c:\myprojects\idl_scan\armv4idbg\msado15.tlh(2921) : error C2501: 'IUnknownPtr' : missing storage-class or type specifiers
c:\myprojects\idl_scan\armv4idbg\msado15.tli(17) : error C2065: '_com_issue_errorex' : undeclared identifier
c:\myprojects\idl_scan\armv4idbg\msado15.tli(21) : error C2143: syntax error : missing ';' before 'tag::id'
c:\myprojects\idl_scan\armv4idbg\msado15.tli(21) : error C2433: 'IUnknownPtr' : 'inline' not permitted on data declarations
c:\myprojects\idl_scan\armv4idbg\msado15.tli(21) : error C2501: 'IUnknownPtr' : missing storage-class or type specifiers
c:\myprojects\idl_scan\armv4idbg\msado15.tli(21) : fatal error C1004: unexpected end of file found
Error executing clarm.exe.
iDL_Scan.exe - 60 error(s), 1 warning(s)
|
|
|
|
|
I wonder, why you need to include .tlh .
Doesn't importing .tlb suffice.
|
|
|
|
|
prasad_som wrote: I wonder, why you need to include .tlh.
Doesn't importing .tlb suffice.
Prasad
I have no idea, but afaik i dont import it explicitly.
|
|
|
|
|
|
XTr1NiTy wrote: c:\myprojects\idl_scan\armv4idbg\msado15.tlh(409) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
See here.
For the others, have you included stdafx.h before the #import statement?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Sorry about that, i know its looong, and that happens when i include the file. If i dont include msado15.dll it doesnt give any errors, but that is with commenting out this code i got from examples (would it work for a sql 2000 database?) :
<br />
HRESULT hr;<br />
CoInitialize(NULL);<br />
try<br />
{<br />
ADODB::_ConnectionPtr connection;<br />
hr = connection.CreateInstance(__uuidof(ADODB::Connection));<br />
if(FAILED(hr))<br />
{<br />
throw __com_error(hr);<br />
}<br />
<br />
ADODB::_RecordsetPtr recordset;<br />
hr = recordset.CreateInstance(__uuidof(ADOBD::RecordSet));<br />
if(FAILED(hr))<br />
{<br />
throw _com_error(hr);<br />
}<br />
<br />
connection->CursorLocation = ADODB::adUseClient;<br />
connection->Open(L"Provider=sqloledb;Data Source=Sunserver;"L"Initial Catalog=IT_DB;User Id=testassword=test;", L,"",L"",ADODB::adConnectUnspecified);<br />
<br />
recordset->Open("SELECT * from Users",connection.GetInterfacePtr(),ADODB::adOpenForwardOnly,ADODB::adLockReadOnly, ADODB::adCmdText);<br />
<br />
<br />
while(!recordset->ADOEOF)<br />
{<br />
_variant_t var;<br />
var = recordset->Fields->GetItem(L"Username")->GetValue();<br />
std::cout << static_cast(_bstr_t(var.bstrVal)) << std::endl;<br />
recordset->MoveNext();<br />
};<br />
<br />
recordset->Close();<br />
|
|
|
|