Jump to content
  • Announcements

    • AndalayBay

      Orphan Attachments   07/31/2018

      I have been doing some housekeeping lately and I've noticed that I had a lot of orphaned attachments. Attachments get orphaned when the PM or post is deleted without removing the attachment first. Deleting a PM or post does not delete the attachment and the file or image remain on the server. I'd like to ask all members to go through their attachments and delete any attachments you don't need anymore or those that have been orphaned. Where can I get a list of my attachments? Click on your display name in the upper right corner of the forums and pick "My Attachments" from the drop-down list. How can I tell an attachment is orphaned? If the PM has been deleted, you'll see a message like this in your attachment list: Unfortunately there is no message if the post has been deleted, so please check your old posts. We do purge old birthday threads every once in a while. Also some hosted projects have been shut down, so you may have orphaned attachments on one of those locations. Thanks!
Sign in to follow this  
Schtearn

Testing Alpha Pre Release Code: Anyone?

Recommended Posts

Hey there,

Finally got this thing going (mostly).

Anyone wish to test to see it works on various Win platforms? Don't think it will work on Non-Windows but prove me wrong. :)

It's supposed to create long path directories.... please go ahead and try!

The conundrum we have is it really wants file drag & drop to make it any use. In order to do that in windows is to #include

<afxwin.h>
so to register the dialog class. It basically means rolling over to MFC which is by no means a bad thing, but it may throw up some obstacles in unexpected areas.

Thoughts?

Edit: Are you the intrepid one today? Try "Run at logon" but it didn't quite work on win 7. CTRL-ALT-DEL should invoke Task Manager, and you should be able to run it from Windows\Temp there.

The links aren't set up in the About Page yet, being only a debug compile, but that shouldn't change things too muchly. And there's not too much in the way of docs, but we hope to get something together soon. :)

Edited by lmstearn

Share this post


Link to post
Share on other sites

Definitely won't work on anything other than Windows and possibly ReactOS in its current form but it should compile using a cross-compiler. Mind if I look at making some changes to try and allow it to compile on more than MSVC? That would allow you to tap into the suggestions provided by other compilers, even if you do the actual compile on MSVC. :)

Share this post


Link to post
Share on other sites

Yes, that'll be interesting, thanks. Anyway going to try to do a separate MFC branch - I think there will be a fair bit of fiddling around to get it going. With a MFC build I think we can strongly discount the possibility of anything non

_WIN32_WINNT
.Perhaps WINE?

We can call the current build "stable" - can we? :P

MFC is only a thin wrapper for the APIs anyway- I may not have to. This is interesting. And DragAcceptFiles looks more promising but it seems dragging out of the application onto an explorer window is a more complex problem.

Edited by lmstearn

Share this post


Link to post
Share on other sites

Will do, I'll see what I can cook up. :)

 

Wine should work but I'm not sure, I never use Wine.

 

You should be able to replace WINNT checks with WIN32 || WIN64 checks as all supported versions of Windows are built on top of the NT platform. That macro may be around from when NT was the business line, before the merge that happened with XP.

Share this post


Link to post
Share on other sites

No problem at all. Glad you want to help. : )

Anyway, after a multitude of brain-farts we have managed to get to classes for the code. One is APP_CLASS which runs the dialogs, and the other is RSC_CLASS which is a WNDCLASS for the resource names. In fact RSC_CLASS is just another window we don't want, so I might ditch it. APP_CLASS might help in code refactoring later.

The upshot is we'll never get the Dlgproc in the WNDCLASS because a wndproc is not a dlgproc.

RSC_CLASS.lpfnWndProc != APP_CLASS::s_DlgProc;
Confusing? Will push up a commit tonight, but hope to get most of the drag 'n drop done this week.

Edit: The code above is supposed to have a strikethrough, we'll chuck in a

!=
nstead. Edited by lmstearn

Share this post


Link to post
Share on other sites

Got drag 'n drop going for one file in but there are two major hurdles:

We are going to have to list files as well as folders, so it means implementing an Owner Draw Listbox. Very nice for MS to supply the code, for without it there are major dramas. :P

The other hurdle is setting the drag for multiple items, I wonder if there is a limit on these sorts of things.

Share this post


Link to post
Share on other sites

There's a limitation of DragQueryFile to 16 files and suspect it's the same with DragQueryFileW. Not surprising as this function hails from the Win 3.1 days. Yes there are better functions around, but not when working with listboxes. :P

And given up on the idea of an owner listbox as the scaling is currently done out of the resource and to change it means starting from scratch. Now as files and folders are enumerated alphabetically by default, there's more fiddling around with the lists... again.

Share this post


Link to post
Share on other sites

So you're using C++, then? You may want to change the file extension so it's either .cc or .cpp and not .c. I was using gcc instead of g++ as I thought it was C. I'll try again with g++ with my changes removed (I made some changes for C compatibility as C is stricter in some areas :P). :)

Share this post


Link to post
Share on other sites

Oh sorry, damn, I'll just get rid of the vcproj file, it shouldn't be there! Wanted to keep it as C sometime ago, but there were issues that somehow couldn't be avoided. Can't remember what they were right now, but might come up with something soon. :)

Edit: Just pushed a more stable version which doesn't get a segfault when listing large directories. As we can't use colours, then just a blank entry to mark the beginning of files.

Edited by lmstearn

Share this post


Link to post
Share on other sites

It looks like you're mixing the use of wide strings and regular strings:

 

 

 

BiggerDirectories.c: In constructor 'APP_CLASS::APP_CLASS()':
BiggerDirectories.c:150:123: error: cannot convert 'LPWSTR {aka wchar_t*}' to 'LPCSTR {aka const char*}' for argument '2' to 'INT_PTR DialogBoxParamA(HINSTANCE, LPCSTR, HWND, DLGPROC, LPARAM)'
    DialogBoxParam(appHinstance, MAKEINTRESOURCEW(IDD_4320P), nullptr, APP_CLASS::s_DlgProc, reinterpret_cast<LPARAM>(this));
                                                                                                                           ^
BiggerDirectories.c:153:123: error: cannot convert 'LPWSTR {aka wchar_t*}' to 'LPCSTR {aka const char*}' for argument '2' to 'INT_PTR DialogBoxParamA(HINSTANCE, LPCSTR, HWND, DLGPROC, LPARAM)'
    DialogBoxParam(appHinstance, MAKEINTRESOURCEW(IDD_2160P), nullptr, APP_CLASS::s_DlgProc, reinterpret_cast<LPARAM>(this));
                                                                                                                           ^
BiggerDirectories.c:156:123: error: cannot convert 'LPWSTR {aka wchar_t*}' to 'LPCSTR {aka const char*}' for argument '2' to 'INT_PTR DialogBoxParamA(HINSTANCE, LPCSTR, HWND, DLGPROC, LPARAM)'
    DialogBoxParam(appHinstance, MAKEINTRESOURCEW(IDD_1080P), nullptr, APP_CLASS::s_DlgProc, reinterpret_cast<LPARAM>(this));
                                                                                                                           ^
BiggerDirectories.c:159:122: error: cannot convert 'LPWSTR {aka wchar_t*}' to 'LPCSTR {aka const char*}' for argument '2' to 'INT_PTR DialogBoxParamA(HINSTANCE, LPCSTR, HWND, DLGPROC, LPARAM)'
    DialogBoxParam(appHinstance, MAKEINTRESOURCEW(IDD_768P), nullptr, APP_CLASS::s_DlgProc, reinterpret_cast<LPARAM>(this));
                                                                                                                          ^
BiggerDirectories.c:162:123: error: cannot convert 'LPWSTR {aka wchar_t*}' to 'LPCSTR {aka const char*}' for argument '2' to 'INT_PTR DialogBoxParamA(HINSTANCE, LPCSTR, HWND, DLGPROC, LPARAM)'
    DialogBoxParam(appHinstance, MAKEINTRESOURCEW(IDD_SMALL), nullptr, APP_CLASS::s_DlgProc, reinterpret_cast<LPARAM>(this));
                                                                                                                           ^
BiggerDirectories.c: In function 'void ErrorExit(LPCWSTR, DWORD)':
BiggerDirectories.c:278:61: error: cannot convert 'LPCTSTR {aka const char*}' to 'LPCWSTR {aka const wchar_t*}' for argument '2' to 'int MessageBoxW(HWND, LPCWSTR, LPCWSTR, UINT)'
  MessageBoxW(nullptr, (LPCTSTR)lpDisplayBuf, L"Error", MB_OK);
                                                             ^
In file included from /usr/x86_64-w64-mingw32/sys-root/mingw/include/minwindef.h:163:0,
                 from /usr/x86_64-w64-mingw32/sys-root/mingw/include/windef.h:8,
                 from /usr/x86_64-w64-mingw32/sys-root/mingw/include/windows.h:69,
                 from /usr/x86_64-w64-mingw32/sys-root/mingw/include/rpc.h:16,
                 from /usr/x86_64-w64-mingw32/sys-root/mingw/include/objbase.h:7,
                 from /usr/x86_64-w64-mingw32/sys-root/mingw/include/shlwapi.h:13,
                 from BiggerDirectories.c:1:
BiggerDirectories.c: In function 'void InitProc(HWND)':
BiggerDirectories.c:289:23: warning: ISO C++ forbids converting a string constant to 'TCHAR* {aka char*}' [-Wwrite-strings]
  TCHAR* pszTxt = TEXT("My Bigger Directory");
                       ^
BiggerDirectories.c: In member function 'INT_PTR APP_CLASS::DlgProc(HWND, UINT, WPARAM, LPARAM)':
BiggerDirectories.c:550:66: error: cannot convert 'const wchar_t*' to 'LPCSTR {aka const char*}' for argument '3' to 'void* CreateMutexA(LPSECURITY_ATTRIBUTES, WINBOOL, LPCSTR)'
    hMutex = CreateMutex( nullptr, TRUE, L"BiggerDirectories.exe" );
                                                                  ^
BiggerDirectories.c:571:57: error: 'GWL_WNDPROC' was not declared in this scope
       g_pOldProc = (WNDPROC)SetWindowLong(TextValidate, GWL_WNDPROC, (LONG)ValidateProc);
                                                         ^
BiggerDirectories.c:571:76: error: cast from 'LRESULT (*)(HWND, UINT, WPARAM, LPARAM) {aka long long int (*)(HWND__*, unsigned int, long long unsigned int, long long int)}' to 'LONG {aka long int}' loses precision [-fpermissive]
       g_pOldProc = (WNDPROC)SetWindowLong(TextValidate, GWL_WNDPROC, (LONG)ValidateProc);
                                                                            ^
BiggerDirectories.c:620:59: error: 'MSGFLT_ALLOW' was not declared in this scope
     if (!(ChangeWindowMessageFilterEx(hwnd, WM_DROPFILES, MSGFLT_ALLOW, nullptr) && ChangeWindowMessageFilterEx(hwnd, WM_COPYDATA, MSGFLT_ALLOW, nullptr) && ChangeWindowMessageFilterEx(hwnd, WM_COPYGLOBALDATA, MSGFLT_ALLOW, nullptr)))
                                                           ^
BiggerDirectories.c:620:80: error: 'ChangeWindowMessageFilterEx' was not declared in this scope
     if (!(ChangeWindowMessageFilterEx(hwnd, WM_DROPFILES, MSGFLT_ALLOW, nullptr) && ChangeWindowMessageFilterEx(hwnd, WM_COPYDATA, MSGFLT_ALLOW, nullptr) && ChangeWindowMessageFilterEx(hwnd, WM_COPYGLOBALDATA, MSGFLT_ALLOW, nullptr)))
                                                                                ^
BiggerDirectories.c:839:5: error: jump to label 'NoAddSuccess' [-fpermissive]
     NoAddSuccess:
     ^
BiggerDirectories.c:673:11: note:   from here
      goto NoAddSuccess;
           ^
BiggerDirectories.c:683:10: note:   crosses initialization of 'int nTimes'
      int nTimes = GetDlgItemInt(hwnd, IDC_NUMBER, &bSuccess, FALSE);
          ^
BiggerDirectories.c:1517:41: error: invalid conversion from 'BOOL (*)(HWND, UINT, WPARAM, LPARAM) {aka int (*)(HWND__*, unsigned int, long long unsigned int, long long int)}' to 'DLGPROC {aka long long int (*)(HWND__*, unsigned int, long long unsigned int, long long int)}' [-fpermissive]
     SwitchResolution (hwnd, AboutDlgProc);
                                         ^
BiggerDirectories.c:178:5: note:   initializing argument 2 of 'int SwitchResolution(HWND, DLGPROC)'
 int SwitchResolution (HWND hwnd, DLGPROC dProc);
     ^
BiggerDirectories.c:1755:64: error: cannot convert 'wchar_t*' to 'LPCSTR {aka const char*}' for argument '3' to 'WINBOOL SetDlgItemTextA(HWND, int, LPCSTR)'
        SetDlgItemText(hwnd, IDC_TEXT, dblclkPath[dblclkLevel-1]);
                                                                ^
BiggerDirectories.c:1811:45: error: third operand to the conditional operator is of type 'void', but the second operand is neither a throw-expression nor of type 'void'
      (CopyFileW(tempDest, currPathW, FALSE))? sendMessageErr = SendDlgItemMessageW(hwnd, IDC_LIST, LB_ADDSTRING, 0, (LPARAM)&dropBuf[pdest]): ErrorExit (L"CopyFile: Copy of dragged file error: ", 0);
                                             ^
BiggerDirectories.c: In function 'BOOL AboutDlgProc(HWND, UINT, WPARAM, LPARAM)':
BiggerDirectories.c:1864:74: error: 'GWL_HINSTANCE' was not declared in this scope
  PlaySound(MAKEINTRESOURCE(IDW_CLICK), (HMODULE)GetWindowLong(aboutHwnd, GWL_HINSTANCE), SND_RESOURCE | SND_ASYNC);
                                                                          ^
BiggerDirectories.c:1877:144: error: cast from 'HINSTANCE {aka HINSTANCE__*}' to 'int' loses precision [-fpermissive]
       ShellError(aboutHwnd, (int) ShellExecuteW(NULL, L"open", L"http://members.ozemail.com.au/~lmstearn/index.html", NULL, NULL, SW_SHOWNORMAL));
                                                                                                                                                ^
BiggerDirectories.c:1884:144: error: cast from 'HINSTANCE {aka HINSTANCE__*}' to 'int' loses precision [-fpermissive]
       ShellError(aboutHwnd, (int) ShellExecuteW(NULL, L"open", L"http://members.ozemail.com.au/~lmstearn/index.html", NULL, NULL, SW_SHOWNORMAL));
                                                                                                                                                ^
BiggerDirectories.c:1905:46: error: invalid conversion from 'BOOL (*)(HWND, UINT, WPARAM, LPARAM) {aka int (*)(HWND__*, unsigned int, long long unsigned int, long long int)}' to 'DLGPROC {aka long long int (*)(HWND__*, unsigned int, long long unsigned int, long long int)}' [-fpermissive]
     SwitchResolution (aboutHwnd, AboutDlgProc);
                                              ^
BiggerDirectories.c:178:5: note:   initializing argument 2 of 'int SwitchResolution(HWND, DLGPROC)'
 int SwitchResolution (HWND hwnd, DLGPROC dProc);
     ^
BiggerDirectories.c: In function 'int wWinMain(HINSTANCE, HINSTANCE, PWSTR, int)':
BiggerDirectories.c:1941:24: error: cannot convert 'const wchar_t [14]' to 'LPCSTR {aka const char*}' in assignment
  ReschkC.lpszClassName = TEMP_CLASS_NAME;
                        ^
BiggerDirectories.c: In function 'int SwitchResolution(HWND, DLGPROC)':
BiggerDirectories.c:2198:52: error: cannot convert 'WNDCLASSEX* {aka tagWNDCLASSEXA*}' to 'LPWNDCLASSEXW {aka tagWNDCLASSEXW*}' for argument '3' to 'WINBOOL GetClassInfoExW(HINSTANCE, LPCWSTR, LPWNDCLASSEXW)'
  if( !GetClassInfoExW( NULL, L"#32770", &RSC_CLASS )) ErrorExit (L"Cannot get App Class!?", 0);
                                                    ^
BiggerDirectories.c:2207:26: error: cannot convert 'const wchar_t [18]' to 'LPCSTR {aka const char*}' in assignment
  RSC_CLASS.lpszClassName = APP_CLASS_NAME;
                          ^
BiggerDirectories.c: In function 'int ExistRegValue()':
BiggerDirectories.c:2410:77: error: cannot convert 'wchar_t*' to 'LPCSTR {aka const char*}' for argument '2' to 'LONG RegOpenKeyExA(HKEY, LPCSTR, DWORD, REGSAM, PHKEY)'
  if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, subKeyName, 0, KEY_QUERY_VALUE, &hKey) != ERROR_SUCCESS)
                                                                             ^
BiggerDirectories.c: In function 'DWORD FindProcessId(HWND, const wchar_t*, HANDLE)':
BiggerDirectories.c:2459:52: error: cannot convert 'CHAR* {aka char*}' to 'const wchar_t*' for argument '2' to 'int wcscmp(const wchar_t*, const wchar_t*)'
         if (0 == wcscmp(processName, pe32.szExeFile))
                                                    ^
BiggerDirectories.c: In function 'void ShellError(HWND, int)':
BiggerDirectories.c:3531:20: warning: ISO C++ forbids converting a string constant to 'wchar_t*' [-Wwrite-strings]
  case 0:       str = L"The operating system is out\nof memory or resources"; break;
                    ^
BiggerDirectories.c:3532:34: warning: ISO C++ forbids converting a string constant to 'wchar_t*' [-Wwrite-strings]
  case ERROR_FILE_NOT_FOUND:  str = L"The specified path was not found"; break;
                                  ^
BiggerDirectories.c:3533:34: warning: ISO C++ forbids converting a string constant to 'wchar_t*' [-Wwrite-strings]
  case ERROR_PATH_NOT_FOUND:  str = L"The specified file was not found"; break;
                                  ^
BiggerDirectories.c:3534:31: warning: ISO C++ forbids converting a string constant to 'wchar_t*' [-Wwrite-strings]
  case ERROR_BAD_FORMAT:   str = L"The .EXE file is invalid\n(non-Win32 .EXE or error in .EXE image)"; break;
                               ^
BiggerDirectories.c:3535:33: warning: ISO C++ forbids converting a string constant to 'wchar_t*' [-Wwrite-strings]
  case SE_ERR_ACCESSDENIED:  str = L"The operating system denied\naccess to the specified file"; break;
                                 ^
BiggerDirectories.c:3536:35: warning: ISO C++ forbids converting a string constant to 'wchar_t*' [-Wwrite-strings]
  case SE_ERR_ASSOCINCOMPLETE: str = L"The filename association is\nincomplete or invalid"; break;
                                   ^
BiggerDirectories.c:3537:29: warning: ISO C++ forbids converting a string constant to 'wchar_t*' [-Wwrite-strings]
  case SE_ERR_DDEBUSY:   str = L"The DDE transaction could not\nbe completed because other DDE transactions\nwere being processed"; break;
                             ^
BiggerDirectories.c:3538:29: warning: ISO C++ forbids converting a string constant to 'wchar_t*' [-Wwrite-strings]
  case SE_ERR_DDEFAIL:   str = L"The DDE transaction failed"; break;
                             ^
BiggerDirectories.c:3539:32: warning: ISO C++ forbids converting a string constant to 'wchar_t*' [-Wwrite-strings]
  case SE_ERR_DDETIMEOUT:   str = L"The DDE transaction could not\nbe completed because the request timed out"; break;
                                ^
BiggerDirectories.c:3540:32: warning: ISO C++ forbids converting a string constant to 'wchar_t*' [-Wwrite-strings]
  case SE_ERR_DLLNOTFOUND:  str = L"The specified dynamic-link library was not found"; break;
                                ^
BiggerDirectories.c:3541:29: warning: ISO C++ forbids converting a string constant to 'wchar_t*' [-Wwrite-strings]
  case SE_ERR_NOASSOC:   str = L"There is no application associated\nwith the given filename extension"; break;
                             ^
BiggerDirectories.c:3542:26: warning: ISO C++ forbids converting a string constant to 'wchar_t*' [-Wwrite-strings]
  case SE_ERR_OOM:    str = L"There was not enough memory to complete the operation"; break;
                          ^
BiggerDirectories.c:3543:28: warning: ISO C++ forbids converting a string constant to 'wchar_t*' [-Wwrite-strings]
  case SE_ERR_SHARE:    str = L"A sharing violation occurred";
                            ^
BiggerDirectories.c:3544:20: warning: ISO C++ forbids converting a string constant to 'wchar_t*' [-Wwrite-strings]
  default:      str = L"Unknown Error occurred"; break;
                    ^
BiggerDirectories.c: In function 'void CreateHyperLink(HWND)':
BiggerDirectories.c:3555:66: error: 'GWL_WNDPROC' was not declared in this scope
         WNDPROC pfnOrigProc = (WNDPROC)GetWindowLong(hwndParent, GWL_WNDPROC);
                                                                  ^
BiggerDirectories.c:3559:67: error: cast from 'LRESULT (*)(HWND, UINT, WPARAM, LPARAM) {aka long long int (*)(HWND__*, unsigned int, long long unsigned int, long long int)}' to 'LONG {aka long int}' loses precision [-fpermissive]
             SetWindowLong(hwndParent, GWL_WNDPROC, (LONG)(WNDPROC)_HyperlinkParentProc);
                                                                   ^
BiggerDirectories.c:3568:63: error: 'GWL_WNDPROC' was not declared in this scope
     WNDPROC pfnOrigProc = (WNDPROC)GetWindowLong(hwndControl, GWL_WNDPROC);
                                                               ^
BiggerDirectories.c:3570:60: error: cast from 'LRESULT (*)(HWND, UINT, WPARAM, LPARAM) {aka long long int (*)(HWND__*, unsigned int, long long unsigned int, long long int)}' to 'LONG {aka long int}' loses precision [-fpermissive]
     SetWindowLong(hwndControl, GWL_WNDPROC, (LONG)(WNDPROC)_HyperlinkProc);
                                                            ^
BiggerDirectories.c: In function 'LRESULT _HyperlinkParentProc(HWND, UINT, WPARAM, LPARAM)':
BiggerDirectories.c:3609:29: error: 'GWL_WNDPROC' was not declared in this scope
         SetWindowLong(hwnd, GWL_WNDPROC, (LONG)pfnOrigProc);
                             ^
BiggerDirectories.c:3609:48: error: cast from 'WNDPROC {aka long long int (*)(HWND__*, unsigned int, long long unsigned int, long long int)}' to 'LONG {aka long int}' loses precision [-fpermissive]
         SetWindowLong(hwnd, GWL_WNDPROC, (LONG)pfnOrigProc);
                                                ^
BiggerDirectories.c: In function 'LRESULT _HyperlinkProc(HWND, UINT, WPARAM, LPARAM)':
BiggerDirectories.c:3625:29: error: 'GWL_WNDPROC' was not declared in this scope
         SetWindowLong(hwnd, GWL_WNDPROC, (LONG)pfnOrigProc);
                             ^
BiggerDirectories.c:3625:48: error: cast from 'WNDPROC {aka long long int (*)(HWND__*, unsigned int, long long unsigned int, long long int)}' to 'LONG {aka long int}' loses precision [-fpermissive]
         SetWindowLong(hwnd, GWL_WNDPROC, (LONG)pfnOrigProc);
                                                ^
In file included from BiggerDirectories.c:7:0:
/usr/x86_64-w64-mingw32/sys-root/mingw/include/strsafe.h: At global scope:
/usr/x86_64-w64-mingw32/sys-root/mingw/include/strsafe.h:525:12: warning: inline function 'HRESULT StringCchPrintfA(STRSAFE_LPSTR, size_t, STRSAFE_LPCSTR, ...)' used but never defined
 STRSAFEAPI StringCchPrintfA(STRSAFE_LPSTR pszDest,size_t cchDest,STRSAFE_LPCSTR pszFormat,...);
            ^
/usr/x86_64-w64-mingw32/sys-root/mingw/include/strsafe.h:552:12: warning: inline function 'HRESULT StringCbPrintfA(STRSAFE_LPSTR, size_t, STRSAFE_LPCSTR, ...)' used but never defined
 STRSAFEAPI StringCbPrintfA(STRSAFE_LPSTR pszDest,size_t cbDest,STRSAFE_LPCSTR pszFormat,...);
            ^
/usr/x86_64-w64-mingw32/sys-root/mingw/include/strsafe.h:326:12: warning: inline function 'HRESULT StringCchCatW(STRSAFE_LPWSTR, size_t, STRSAFE_LPCWSTR)' used but never defined
 STRSAFEAPI StringCchCatW(STRSAFE_LPWSTR pszDest,size_t cchDest,STRSAFE_LPCWSTR pszSrc);
            ^

 

 

If you change

MAKEINTRESOURCEW
to
MAKEINTRESOURCE
, that will tell the API to pick the right function based on whether or now Unicode is in use. :)

 

As for the header errors in the log, pay them no heed: that's from a bug in the MinGW headers that I can't convince them to fix for some reason (and boy have I tried...). :P

 

Edit:

 

MessageBoxW
too. General rule is if a function has an A and W variant, go without A or W at the end unless you really need to force the use of one and define the Unicode macros if you're wanting to use wide-strings. :)

 

Edit 2:

 

On a similar note, you don't need to prepend strings with L first unless you're saying explicitly that it's a wide-string. If you're using regular ASCII characters, you don't usually need L.

 

Edit 3:

 

Where does

GWL_WNDPROC
come from? GCC is complaining about it not being declared. Edited by Visceral Moonlight

Share this post


Link to post
Share on other sites

Oh bum, then it's a bit fussy, but thanks.:)

Changed the functions mentioned and the GWL to GWLP.

Can change the L" of everything to TEXT() but that's a bit laborious,- but fixed the above-mentioned.

The goto is interesting: is that a compiler setting in G++? Ah- now I know what fpermissive is.

Pushed up a new lot, but think there will be more problems.

Share this post


Link to post
Share on other sites

That was easy, thanks. :)  Does it build now? The compiler spits at this in the header, here's hoping we can leave it out:

BOOL (WINAPI * ChangeWindowMessageFilterEx)(HWND,UINT,DWORD) = NULL;

Tou know, I think there is a problem in the program not picked up by the warnings, Maybe the G++ compiler can detect something- more info here.

I can't believe I have just wasted 90 minutes on another problem, see the comment below this question.

Edit: Pushed up another lot, making headway, just got to fix the delete_files and then it's off to drop targets. :)

Edited by lmstearn

Share this post


Link to post
Share on other sites

That looks like a missing header warning for ChangeWindowMessageFilterEx.

 

For clarity, what's going on is VS includes a lot of headers, links libraries, and defines macros implicitly and pulls them in from the project files while GCC wants them done explicitly in the code. Even when using a build system, you need to explicitly pass the stuff to GCC and they aren't automatically generated like they are for VS. Just wanted to explain that to help clarify why GCC is complaining about things. :)

 

I won't be able to test the building for a couple of days but when I do, what do you think about the idea of me having a look to see about replacing some uses of the C standard library with the C++ standard library?

Share this post


Link to post
Share on other sites

Yes, in fact it's probably best after all the drag & drop is finalised. The diehards over at SO and MSDN reckon that drag & drop is best done with OLE, well, yes,true, but I just want to avoid the weight of any more includes- and as we're working with a listbox with drag_in not focus on any of the sub-controls ergo a rather basic affair anyway.

The original idea of this was to try and keep it as C- like as possible all the while entertaining a very small but far receding hope it'll ever get there, what now with UD classes and the like. :P

Share this post


Link to post
Share on other sites

Heavens no, just want to take some of the cruft out of the code as much as possible before anyone gets a little spooked.  :frightened:

In this learning experience I'm now beginning to see some of the limitations of C - What are some of the C++ Standard Library features were you interested in?

The problem now is to delete  a file (avoiding Ioperation or ShfileOperation which may not handle long paths) while using  Copyfile.  A handle to the Recycle Bin can be retrieved here.

Edited by lmstearn

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×