Hehhh, i will precisice my problem, maybe you mitunderstood me... I want to carry out my application with the file association, but generally the file will be locked from the shell... I hoped it exists any shell settings to share the file... :)
HumanOsc
Posts
-
How to unlock an application associated file? -
How to unlock an application associated file?Hi... I have a App which is associated with an specified file type... So when i execute this data file, my application will be launched... My Problem is that in this situation the data file will be locked and f.e. i can't rename them... Exist any solution to prevent this locking mechanism ? THX... :) -- modified at 13:40 Friday 12th May, 2006
-
Handling Events inside a "while" clauseOk, sorry it was my fault... Sometimes i mix two different classes... I mean the SelectedItems Property...
if(listView.SelectedItems.Count == 0) return;
You should check the collection if it's contains items, before you get anyone... Well, in your app in the SelectedIndex_Changed handler...// get sure that one item is selected if(listViewCatalogo.SelectedItems.Count == 0) return; i = listViewCatalogo.SelectedIndices[0];
-- modified at 7:28 Tuesday 14th February, 2006 -
Handling Events inside a "while" clause1.) You can use the SelectedIndex Property to check if an item is selected...
if(listView.SelectedIndex == -1) return;
2.) It's recommend to disabling the updateing mechanism when you are adding items...// disable updating mechanism listView.BeginUpdate(); while(...) { // adding items here } // enable updating mechanism listView.EndUpdate();
By the way you should named you variables more significant... ;) -
TCP port detection/scanningHello again... Look at: http://www.c-schell.de/home/cpp/source/gull.c[^] This an example in pure c... I believe this can be helpful for your problem, too...
-
TCP port detection/scanningHello... Look at: http://www.codeproject.com/internet/NagTPortScanner.asp[^] Not very good explained but a smart introducion about TCP SYN scanning... # Best regards... :)
-
How to wait for thread & if no response within time abort itHello... Roger Stoltz wrote: if( ::WaitForSingleObject( hThread, 100 ) == WAIT_TIMEOUT ){ ::ExitThread( hThread );}::CloseHandle( hThread ); This is wrong, ExitThread must be always called from that thread which should be end... That means inside the worker thread... When you like to end a thread outside from worker thread then must use GetExitCodeThread and TerminateThread... But in the most situations it exists an better solution...
-
Problem with FileIOCompletionRoutine ???Hello... This is very guru like solution... :) Big Thx, greets from germany...
-
How to wait for thread & if no response within time abort itHello... First, You use MFC then you should you use the Threading function from MFC like AfxBeginThread because some MFC internals need to prepared for Threading... When you use the pure API calls in the MFC it can produce unexpected situations and also Memory Leaks... Second, when you use the pure API then always closing the Thread Handle... Third, Use the Sleep function in your worker thread to enforce a context switch this can improve the performance of your app... Fourth... I believe you should read some more articels about threading before you continue your work... :) You can find the most important facts about threading here (especially for MFC) : http://www.codeproject.com/threads/usingworkerthreads.asp[^] Best regards...
-
CryptAcquireContext fails on other machinesHello... Yes, i believe i have an idea... I think on the other machines it isn't the requested CSP installed (this are dll's which provides cryptography algorithm)... For more information read: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/seccrypto/security/cryptographic_service_providers.asp[^] Best regards...:)
-
Global variable probHello... benjnp wrote: I thought redeclaring the struct will reset all its values or perhaps reinitialize them. No, only without the extern keyword... With the extern keyword you can declare global variables over many files without to reset them... They will be all associated to the first declaration... :)
-
Problem with FileIOCompletionRoutine ???Hello... I like to implement WriteFileEx / ReadFileEx in one of my classes... Is there any safe way to implement LPOVERLAPPED_COMPLETION_ROUTINE as a (non static) member function ? :doh: Thx... :-D -- modified at 5:09 Wednesday 14th September, 2005
-
Image dislaying and processing in C#Hello... The point of the question is : how portable should be your app... To use Managed DirectX u need to install it... Ok... But Managed DirectX is one possible way to optimize your performance... Another way is to use Platform Invoke from the native Window GDI API... f.e.: the native StretchBlt Function to doing zooming operation... Best regards... ;)
-
Can not marshal parameter #4: The type definition of this type has no layout information.Hello... I believe you forget to define the StructLayoutAttribute for the paramater NETRESOURCE* p... In general it'S Sequential...:)
-
read more bytesHello... Try something like this: public MemoryStream Read(int bufSize) { byte[] BufBytes = new byte[bufSize]; MemoryStream stream = new MemoryStream(); /*-- Check Port is Open --*/ if( hComm != INVALID_HANDLE_VALUE ) { OVERLAPPED ovlCommPort = new OVERLAPPED(); int BytesRead = 0; while(ReadFile(hComm, BufBytes, bufSize, ref BytesRead, ref ovlCommPort) != 0 /* or true (based on your interop declaration) */) stream.write(BufBytes,0,BytesRead); } return stream; } Remark: This is code is not tested (it can contains some small bugs but the base concept will work)... ;)
-
static Method And Thread SafetyHello... In other words: 1. Every Thread contains his own stack... 2. Local variables are always stored on the stack from the specified thread (each one have its own copy)... --> The static keyword before functions haves no effect on there locals... :)
-
subclassing conceptHello... mx483 wrote: What's the difference? Nothing... In front of the subclassing concept... It's only a difference of the design concept... I believe you have read two different solutions of subclassing, the first "used by itself" in the good old c style without inhertance and the other one in c++ with oo aspects... :) Best regards... :)
-
How to get the Font width ???Hello Mark... Thx for your comments... It helps me a lot to understand the difference about logical untits and the real size on dc'S... Mark Petrik Sosa wrote: I can't see where you'd use it without a DC I need the width of the font in some calculations of my new app... But before the window is drawing... At this point the explicit creation of a dc handle to retrieve only the width of the font looks very involved... Best regards... :)
-
How to get the Font width ???Hello... Mhhh... Mark Petrik Sosa wrote: Without a DC a real width doesn't exist until it's associated with a DC. I don't understand ? :doh: I think the LOGFONT height it's the height of the font. The size is fixed and independent from the dc... What's the different about the width... When i create a font with a height of 20 pixels then is height from the font on a screen dc different as from the printer dc, but i think it's difference about the resolution and the count of pixel per inch... Can you explain your idea? Best regards...
-
Problem with "Create a FrameWnd inside a thread"Hello again... My solution is based on the great Articel from Joseph M. Newcomer: http://www.codeproject.com/threads/usingworkerthreads.asp[^] This is a very nice Introduction about worker threads. Be carefull about SendMessage, it can also produce unexpected situations like a deadlock from your app... Always prever the use of PostMessage to provide a safe gui access. But Sometimes it's recommend (before or after the end of a worker thread) to get sure thats no (old) messages exists in the message queue. In this situations use PeekMessage, GetMessage and DispatchMessage in main thread to remove (process) all old Message from Queue... Best regards... :-D