Microsoft extension:_tmain and wx. Topic is solved

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
tuk1
Earned some good credits
Earned some good credits
Posts: 114
Joined: Sun Oct 08, 2017 9:36 am

Microsoft extension:_tmain and wx.

Post by tuk1 »

https://msdn.microsoft.com/en-us/librar ... s.85).aspx

_tmain is a windows macro/extension or the ms version of the standard main() function found in c++.

The sample function from the link above and shown below... calls the code:

Code: Select all

void _tmain(int argc, TCHAR *argv[])
{
    if(argc != 2)
    {
        _tprintf(TEXT("Usage: %s <dir>\n"), argv[0]);
        return;
    }

    WatchDirectory(argv[1]); <<<<---calls the code
}
How can I implement this _tmain function in my wx code which doesn't appear to have a main function as such?
wxWidgets(v3.2.2.1) - Vs2022(v143) - Win10(x64) - DialogBlocks(v5.16.5_Unicode)
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Microsoft extension:_tmain and wx.

Post by ONEEYEMAN »

Hi,
Why do you want such function?
Is standard wx classes not enough?

Also take a look at the console sample and fswatcher sample.

Thank you.
tuk1
Earned some good credits
Earned some good credits
Posts: 114
Joined: Sun Oct 08, 2017 9:36 am

Re: Microsoft extension:_tmain and wx.

Post by tuk1 »

Need an efficient way of knowing when a file has changed.
Current code makes frequent polls of the file to detect changes, which isn't so efficient.
Didn't think to look at wx lib for a solution as I'm still coming to terms with the fact that wx is a bit more than just a UI lib.

Need a few days to play with the code in the fswatcher sample which does look promising.
wxWidgets(v3.2.2.1) - Vs2022(v143) - Win10(x64) - DialogBlocks(v5.16.5_Unicode)
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Microsoft extension:_tmain and wx.

Post by ONEEYEMAN »

Hi,
Yes, everything that is available in the library has it own sample - you just need to know which feature and which sample. ;-)

Come back here if you have more questions.

Thank you.
Post Reply