|
I need to display a tif file as a thumbnail on a dialog box. Is there any Activex control available that I can use?
thanks
Man Learns from History that he never learns from History
|
|
|
|
|
Check out
http://www.codeproject.com/vcpp/gdiplus/GdiPThumbnailsViewer.asp
But it is in GDI+ and MFC though
Sonork 100.41263:Anthony_Yio
Life is about experiencing ...
|
|
|
|
|
I can't achieve this process in .Net Visual C++.
I use below code and the interpreter doesn't give any error at compile time but an error is occours at run time ("object referance not set to an object instance")
char *dosya;
String *dizi;
dizi=textBox1->Text;
dosya=new char(512);
dosya=reinterpret_cast<char *="">(dizi->ToCharArray());
also I used below code and the compiler gave an error at run time ("index was outside of range" like this I can't remember completly)
dosya=reinterpret_cast<char *="">(dizi->get_Chars(dizi->get_Lenght()));
for summary I can't get the characters from a System::String class to a char pointer. (instead of char to use wchar_t variable didn't solve the problem
|
|
|
|
|
a look at msdn brings the following solution:
using namespace System::Runtime::InteropServices;
const char* str = (const char*)<br />
(Marshal::StringToHGlobalAnsi(managedString)).ToPointer();<br />
Marshal::FreeHGlobal(IntPtr((void*)str));
We are men. We are different. We have only one word for soap. We do not own candles. We have never seen anything of any value in a craft shop. We do not own magazines full of photographs of celebrities with their clothes on. - Steve
|
|
|
|
|
How do i query for modems connected to the pc??
Thanx.
I'll write a suicide note on a hundred dollar bill - Dire Straits
|
|
|
|
|
So are you wanting to know about printers or modems?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
DavidCrow wrote:
So are you wanting to know about printers or modems?
hehe,
my mistake, its modem
EnumPrinters(...) will do for printers, could not find something similar for modems.
I'll write a suicide note on a hundred dollar bill - Dire Straits
|
|
|
|
|
How about the Win32_POTSModem WMI class?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
DavidCrow wrote:
Win32_POTSModem
Thanx but this class requirement is win2k and above, looking for something that will work in win98 as well.
Here is one logic i developed , havent tested it yet.
first enumerate through all the ports in the pc,
create a handle to it by using CreateFile api.
then call GetCommProperties(...) get the info about the handle, the structure returned gives the info wheather its a printer, modem, etc.
How is this logic? only problem i feel is that since i have to create a file handle of the port, i woun't be able to do it if its already in use.
I'll write a suicide note on a hundred dollar bill - Dire Straits
|
|
|
|
|
Mr.Prakash wrote:
Thanx but this class requirement is win2k and above, looking for something that will work in win98 as well.
It usually helps to list all of the requirements up front so that we can avoid unnecessary suggestions.
Mr.Prakash wrote:
How is this logic? only problem i feel is that since i have to create a file handle of the port, i woun't be able to do it if its already in use.
It sounds solid, but the only way to know for sure is to try it on several machines. At a minimum, you'd need:
a machine with no modem and no network card
a machine with a modem and no network card
a machine with a network card and no modem
a machine with both a modem and a network card
The only reason I suggest a network card is to verify that the code can differentiate between different types of network connections.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
DavidCrow wrote:
It sounds solid, but the only way to know for sure is to try it on several machines
yeah will do that soon
Thanx again.
I'll write a suicide note on a hundred dollar bill - Dire Straits
|
|
|
|
|
In Win32 you would normaly do hardware enumeration to determine if a modem is attached (search codeproject articles). Another method, is to send an AT command out the known ports and check the result (string or code) that is return, if any.
That is all!
INTP
|
|
|
|
|
Thanx.
I'll write a suicide note on a hundred dollar bill - Dire Straits
|
|
|
|
|
I got stuck on a project where it is needed to tell the path name of the program(if any) that is associated with a particular file type, i.e. I should be able to get "c:\\windows\\system32\\notepad.exe" from ".txt". I checked in HKEY_CLASS_ROOT but not every entry there has a "shell\\program" key so I think there must be other ways to retrieve the associated program...
Thanks for your help.
|
|
|
|
|
As I remember the solution is using the function AssocQueryString. Unfortunately I have no source code here for an example.
Jens
|
|
|
|
|
Try this:
char szAssocProgram[MAX_PATH];
DWORD dwSize = MAX_PATH;
HRESULT hr = AssocQueryString(0, ASSOCSTR_EXECUTABLE , ".txt", NULL, szAssocProgram, &dwSize);
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I see this in the on-line docs and it says it is available for 2000 and 98 but my version of shlwapi.h in MSVC v6.0 SP6 does not have it.
Which version of shlwapi.h does have it ?
__________________________________________
a two cent stamp short of going postal.
|
|
|
|
|
Sounds like you need the (updated) Platform SDK.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Thanks for the replies, I really appreciated. geeze, CP is such a good place to hang around...
|
|
|
|
|
The return key on my laptop doesn't work.How do I map the right shift key as the return key. In other words, when I press the right shift, it appears a return in the program.
This is urgent, thanks a lot.
frank
|
|
|
|
|
please explain more !
what do you expect to have, what happens ?
TOXCCT >>> GEII power
|
|
|
|
|
I would think you'd need to create a keyboard hook using SetWindowsHook[Ex]() . When VK_RSHIFT is detected, replace it with VK_RETURN . As I've never tried this, it's only a guess.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I have been trying to send an event from a DLL (Dynamically loaded) to a GUI application to display text.
I use shared memory for the transfer of data, also in this shared data area in the handle for this event.
In the DLL I
m_pMsg->hGlobalWriteEvent = CreateEvent(NULL, // no security attributes
FALSE, // manual-reset event
FALSE, // initial state is signaled
"CSLDisplayData" // object name
);
Note m_pMsg is a pointer to the shared memory area.
Then I send the event:-
// Signal GUI to process this request
::SetEvent(m_pMsg->hGlobalWriteEvent);
Now in the GUI I have a thread waiting on this event.
if (::WaitForSingleObject(ThreadData->m_pMsg->hGlobalWriteEvent, INFINITE) == WAIT_OBJECT_0)
{
etc
But this event in the GUI is never fired.
Note I can create and send an event to the thread from the GUI but not from the DLL.
What can I do?
|
|
|
|
|
You do not have to use shared memory in this case.
Just create an event in the GUI and in the DLL and use the same name for both CreateEvent calls. That should do the trick.
Jens
|
|
|
|
|
I have tried that and the only way the events will work if the GUI creates and sets the event.
I cant get working the DLL to create and set an event that the GUI will receive.
Nothing happens?
I thought it was the name that was importance, but decided to use the same handle and that does not work either!!!
|
|
|
|