|
In that case, you should look into the LVN_BEGINDRAG message, which sounds like what you need.
|
|
|
|
|
By the way, I just looked at some old code of mine and saw that we handled WM_LBUTTONDOWN, WM_MOUSEMOVE, WM_LBUTTONUP and LVN_BEGINDRAG. We handled all these messages to have control over changing the mouse cursor to represent what was being moved or in some cases to display a shape that indicated something that could not be dragged. Handling these messages also enabled us to change the cursor to indicate a valid "drop zone".
|
|
|
|
|
Hi Folks,
I am using a Library (OpenCV) for image processing in Vc++ 6.0;
The problem i am getting in compiling the application is that when i compile my application it works fine but when i try to execut, it give error saying "highgui096.dll" not found re-installing may fix the problem;;;
when i copy this dll file to my project folder it runs. fine ;;;
tell me where to add path for this dll so it may be used in all projects....
Regards,
Bye
|
|
|
|
|
c:\Windows\system32 like all dll's. You must also include it in your installation set up.
|
|
|
|
|
The path is NOT \system for Win32!!!
It is system32, and also the windows path may be different to C:\Windows!!
(Can be C:\WINNT on Win2k, for example)
Don't try it, just do it!
|
|
|
|
|
See GetSystemDirectory
The GetSystemDirectory function retrieves the path of the system directory. The system directory contains system such files such as dynamic-link libraries, drivers, and font files.
|
|
|
|
|
This is your DLL or some other company? If you are creating an installation package is it not reccomended to put things into the "SYSTEM32" directory anymore. This is reserved for Windows System files and possibly other very specific files (See Microsoft for details "Services and device drivers should be placed in the system directory").
This is what is required if your application would like to have the "Designed for Windows" logo. However, even if you are not shooting for this logo is it best to read the requirements and use them as a "best practices" since it is what Microsoft is reccomending rather than randomly place files anywhere you want on the system.
Chapter 2[^]
Referr to "4. Install Shared Files to the Correct Locations" to determine where the correct location would be for your specific files.
8bc7c0ec02c0e404c0cc0680f7018827ebee
|
|
|
|
|
To be really hard core, create a folder under the 'Common Files' place your DLL there.
Then make an App Paths registry entry for your programs that need access to the DLL and have one of the folders for the App Paths entry be this common folder.
Problem solved, and logo compliant.
|
|
|
|
|
"Hard code" install
8bc7c0ec02c0e404c0cc0680f7018827ebee
|
|
|
|
|
Toby Opferman wrote:
8bc7c0ec02c0e404c0cc0680f7018827ebee
What does this Means
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
You will be sorry that you asked
This is actually the machine code of a program I wrote a long time ago. This is whole program and it was basically in "TINY" .COM format. The .COM format is a raw binary format that contains no headers and only raw binary code and data. The .COM is limited to 64k of memory - sizeof PSP - your stack.
The PSP was the first 256 bytes of the segment and at offset 100h (256) your raw binary code would be loaded. This file format's elegance of having no header information made it a perfect candidate for "lowest bytes" competitions. If you used to do the very small ones you know that you would ask what rules would need to be applied to the competition, such as:
1. Can I print garbage?
2. Can I assume certain registry values?
3. Can I use x or y interrupt?
4. Can I use this or that trick?
So, in MS DOS you could assume certain values of registers on entry. These were:
DI = FFFEh
SI = 100h
AX = 0
BX = 0
CX = 00FFh
The binary code that is in my signature looks like this in 16 bit:
8BC7 MOV AX,DI
C0EC02 SHR AH, 2
C0E404 SHL AH, 4
C0CC06 ROR AH, 6
80F701 XOR BH,01
8827 MOV [BX],AH
EBEE JMP 0100
"JMP 100" means jump back to the top of this program since 100h is the starting offset. So, without further evaluation of what this code is doing it looks like it's an infinite loop.
Let's examine what is going on though.
1. MOV AX, DI ; AX = DI = FFFEh
2. SHR AH, 2 ; AH = FF, AH>>2 = 6Fh
3. SHL AH, 4 ; AH = 6F, AH<<4 = F0h
4. ROR AH, 6 ; AH = F0, AH Rotate 6 = C3h
5. XOR BH, 1 ; BX = 0, BX = 100h
6. MOV [BX], AH ; BX = 100h, Ah = C3h, [100h] = C3h
7. Jmp to 100h (256)
So, what happens is that we take FFFEh into AX then we take the top half and do a few funny tricks just to confuse and eventually rotate the result into C3h.
Then what happens is the high byte of BX is set to 1 through the 0 xor 1 = 1 which makes BX = 256. We then move the value of AH into the memory location of 100h.
The final jump goes to 100h which now contains the value of C3h. You could say that if the cache isn't flushed it would contain the old value of MOV AX, DI however the JMP instruction should have flushed it.
In any case again we have another trick in that the Stack is said to be initialized to 0. C3h = RET instruction or Return which takes the address on the stack and jumps to that location. In this case, it's 0.
What's at 0? The PSP is at 0 and the first two bytes of the PSP is CD20 or "INT 20h" which was the original method of exiting a .COM application (preceeded by the .EXE method of INT 21h with function 4fh).
So that's it. The code is just self modifying code that does nothing but return.
On a side note, the extension of .COM and .EXE does not matter. The first two bytes of a .EXE (LE, NEHDR or PE format) are "MZ". The loader ignores ".COM" and ".EXE" and looks for these two bytes. If it finds them it attempts to load as a .EXE if not, then .COM. The only difference the .COM and .EXE extensions made was the loader looks for .COM first then .EXE. So if two applications named "x.com" and "x.exe" were in the same directory and you typed "x", "x.com" would be the only one executed. And it could even be in .EXE format!
8bc7c0ec02c0e404c0cc0680f7018827ebee
|
|
|
|
|
Nice Secret behind that Hexadecimal Number , I have preserved this post for ever in my personel BLOG .
Toby Opferman wrote:
You will be sorry that you asked
Nope,I am happy to know about it
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Change the path global varible of the current user!
Don't try it, just do it!
|
|
|
|
|
If it is a DLL that is only used by this program then just staticaly link to it and have done with it or copy it to the application folder/directory.
If it is a DLL that is provided by a third party (which the name suggest), then it should be installed in the system directory. Now the system directories location dependes on the oprerating system. This appears to be a problem (unless you are using VBSCRIPT or JAVA), assuming it does not have its' own install program.
If you have a (third party) install creation program, then use it to create your own installation program.
Otherwise; You have one of the following options:
Win31: Windows\system
Win95: Windows\system or Windows\system32
Win98: (see Win95)
WinMe: (see Win95)
WinNT: WinNT\system (dependences on verstion)
Win2000: WinNT\system or WinNT\system32
WinXP: Windows\system or Windows\system32
What all this amounts to is that the OpenCV.??? has to be in the search path.
Ok, don't start pulling out your hair, you'll figure it out.
Good Luck!
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Thank you, but I have already tried the code provided by cedric moonen but this time following error comes.
'AfxBeginThread' : ambiguous call to overloaded function
What is ambiguous...
Please help me.
Thanks
Aqueel A. Mirza
We Believe in Excellence
|
|
|
|
|
Aqueel wrote:
ambiguous
it means the compiler can't tell which function you want to call. there are probably two functions with the same name and similar parameter lists, and the compiler can't tell, from your input parameters, which one to call.
you need to find out which functions it is confused about, and find a way to tell it which you want . casting your parameters to the exact type the function wants is a simple way to do this.
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
try using :: Scope Resolution Operator
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
I'm confused and hope someone can enlighten me.
I have successfully programmatically set up a "Shared Folder" on one computer. I want to access that folder and retrieve files from that folder, but do it from another computer. Both computers are connected to the Internet. It was my understanding that I could reference a file on the "other" computer with something like
"\\123.21.105.6\SharedFolder\Test.txt"
and that I could access it (from my C++ program)with something like:
FILE* theFile;
theFile = fopen("\\123.21.105.6\SharedFolder\Test.txt", "r");
But that doesn't work. It never succeeds in openning the file.
I've been looking all over the internet for information on how to do it correctly but I'm only getting more and more confused.
My impression (now) is that the above approach is wrong, and that there needs to be some kind of server running on the target computer and that I have to communicate with that server in order to retrieve the desired file, or that I have to use some kind of file transfer protocol (ftp?) in order to do it.
What I really need is some straightforward explanation or (ideally) actual C++ code that says, "you've got a file on another computer's shared folder, here's how to get it..."
But the best that I've come across are things like, "here's 100,000 lines of code, with 2,586 classes, and somewhere in there is the way to access files on another computer, have fun figuring out how."
Any help/advice on this would be greatly appreciated.
Roger Garrett
|
|
|
|
|
Roger Garrett wrote:
FILE* theFile;
theFile = fopen("\\123.21.105.6\SharedFolder\Test.txt", "r");
But that doesn't work.
Can you imagine the security implications if it did work?
If you have access to both the server and the client, you need to implement a socket-based program where the server listens for requests from the client on some specific port (you could also see if the server is already handling FTP requests on a port such as 21). Once the server "hears" the request, it would then start the process of sending the file back to the client.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I do understand the security issues.
And I understand about implementing a file retrieval mechanism by having a specific server program running on the target computer and a client program running on my computer. I've written such a program. But I ran into a problem in which the computer running the server isn't "allowed" to receive such incoming requests, per restrictions by the ISP of that computer (in particular, a computer connected to the Internet through Earthlink as their ISP cannot sucessfully run such a server because Earthlink doesn't allow it).
So I thought that perhaps using a shared folder on the target computer might work. I can successfully set up the shared folder on that other computer (with a password if necesary), and then I thought I should be able to access that folder, somehow. But I haven't figured out how. Or at least in all my attempts I haven't succeeded in openning the file.
Suggestions?
|
|
|
|
|
Roger Garrett wrote:
But I ran into a problem in which the computer running the server isn't "allowed" to receive such incoming requests, per restrictions by the ISP of that computer (in particular, a computer connected to the Internet through Earthlink as their ISP cannot sucessfully run such a server because Earthlink doesn't allow it).
I doubt you would be able to share a folder over the internet, from memory the required protocol/access mechanism for shared folders etc relies on Netbios and I dont think this CAN traverse the internet - I dont think its routable for example, although I'd have to collar one of our comms team to double-check, and its the Saturday of a long weekend down here (Australia)
Now, if it was company internal for example, you could do the same as a
net use x: \\abc.def.hij\d$ password /USER:\domain\user /PERSISTENT:NO
and yep, there are NET Api's for doing such - so you could connect to the share on startup for example and read the file from the 'X:' drive - I just dont think this is going to help you, sorry Roger.
'G'
|
|
|
|
|
Has anyone else seen asserts getting thrown when the condition blatantly evaluates to true when viewed in the debugger?
I think the application I've inherited just wants to cause me grief :-S
---------------------------
Microsoft Visual C++ Debug Library
---------------------------
Debug Assertion Failed!
File: z:\sdk\microsoft\vc71\atlmfc\include\afxtempl.h
Line: 321
For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.
(Press Retry to debug the application)
---------------------------
Abort Retry Ignore
---------------------------
afxtempl.h line 321 is
ASSERT(nIndex >= 0 && nIndex < m_nSize);
and
nIndex = 180
m_nSize = 181
arrgh!!!!!
--
Help me! I'm turning into a grapefruit!
Buzzwords!
|
|
|
|
|
That sure looks pretty weird.
Maybe try adding some parentheses:
ASSERT((nIndex >= 0) && (nIndex < m_nSize));
or...
BOOL bItIsTrue = ((nIndex >= 0) && (nIndex < m_nSize));
ASSERT(bItIsTrue);
and see how it behaves,
|
|
|
|
|
That was my thought as well, until I realised that the misbehaving code is part of MFC, so not something I can tinker with
--
Help me! I'm turning into a grapefruit!
Buzzwords!
|
|
|
|
|
Are you certain that you're looking at the correct ASSERT, i.e. the correct position within the correct afxtempl.h file? Did the debugger take you directly to the offending line of code, or did you just look for the afxtempl.h file and go to the specified line? I took a look at afxtempl.h on my machine and that line number doesn't have an ASSERT. There's lots of references to m_nSize but noone contained within an ASSERT. So maybe you're looking at a wrong afxtempl.h file.
|
|
|
|
|