|
I need a library that implements a behaviour of Petri Nets. I know it wouldn't be too hard to implement the functionality myself, but establishing the link with Petri nets is just a secondary (if not tertiary) goal of my course project and a have not enough time to invent a bicycle.
|
|
|
|
|
What about Maria:
http://www.tcs.hut.fi/Software/maria/
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
I would like to detect when the mouse is on any of the edges of the screen and then the user moves the mouse in such a manner that the mouse would go off-screen if it was allowed to do so. I've tried using WM_MOUSEMOVE messages, but the lParam/POINT structure never has negative values. Another option I could see is storing the mouse position from the previous mousemove message and then calculating a slope and whatnot and see if its in certain bounds to consider it to be going off-screen. This is hardly a ideal approach and wouldn't work if the mouse was already near the edge of the screen. I'm sure there is a better way, but I don't have any clue what it could be. Any suggestions?
Thanks,
Aaron
modified 12-Jul-20 21:01pm.
|
|
|
|
|
The best I can see is to detect when it is on the edge of the screen. One of the things you may have notice with programs like the Taskbar is when they hide, they always leave one of the edges showing (at the edge of the screen)so than can detect when mouse (hot spot) passes over it.
INTP
|
|
|
|
|
Thanks, that's always an option, and it looks like that's what I'll go with. A couple pixels probably isn't going to make much of a difference anyway. The reason I ask is I've seen apps, like mouse wrappers, that seem to work the way I want.
Thanks,
Aaron
modified 12-Jul-20 21:01pm.
|
|
|
|
|
What would be the reason for getting following linking error?
a) LNK2019: unresolved external symbol _WinMain@16 referenced in function _WinMainCRTStartup
b)LNK1120: 1 unresolved externals
|
|
|
|
|
LNK2019 is a .NET thing, but you'll also see it as LNK2001 on other platforms. See if this helps.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Thank you very much it is really helpful and now I got no more linking error.
Thank you again.
|
|
|
|
|
Sounds like you setup the project to build a Windows application, when you've probably coded for a console application. To fix the unresolved external symbol_WinMain@16 referenced in function _WinMainCRTStartup go into your project settings and change the "/subsystem:windows" project setting to "/subsystem:console". That should clear up the error. Hope this helps.
Regards,
|
|
|
|
|
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)
|
|
|
|