Any questions from a PROFI to a SUPER PROFI - 1. - page 11

 
joo:

Did this, still the same error:

Zhunko:

Was the project copied into VC++ 6.0 with its properties or was it set up separately?

I've had three occasions where I've used functions in VS 2010 that aren't available in XP. Everything worked on Vista and 7, but the terminal didn't see the library on XP.

Zhunko:

I wrote it in the beginning of the topic. It happens when you use WinAPI functions which are absent in XP. Yet another reason. If the minimum system version is limited by a higher one.

I'm experiencing the same thing now. I've never got around to searching for this function.

 

Zhunko:

joo:

Did this, still the same error:

Zhunko:

Was the project copied into VC++ 6.0 with its properties or was it set up separately?

I've had three occasions where I've used functions in VS 2010 that aren't available in XP. Everything worked on Vista and 7, but the terminal didn't see the library on XP.

Zhunko:

I wrote it in the beginning of the topic. It happens when you use WinAPI functions which are absent in XP. Yet another reason. If the minimum system version is limited by a higher one.

I'm experiencing the same thing now. I've never got to look for this function.

I found the reason! But I don't know what to do with it.

The problem turned out to be in this construct of a class method with static methods:

    static HWND HandleByProcessIdAndClass()
     {
      HWND   hwndLocal = NULL; // Дескриптор искомого окна.
      size_t i = 0;

      ::EnterCriticalSection(&GetInstance()->csOne);
      ::EnterCriticalSection(&GetInstance()->csMultiple);
     ................. Здесь защищаемый код ...................
      ::LeaveCriticalSection(&GetInstance()->csMultiple);
      ::LeaveCriticalSection(&GetInstance()->csOne);
      return(hwndLocal);
     }

Once you remove synchronization (highlighted in red) - the library becomes visible for XP. On Vista it works.

Maybe it's not enough version of some system library?

=======

About this class, I need to clarify.

All the class methods with static "Windows" methods, and there are about 80 of them, have similar synchronization.

The specified method is called first in the constructor of an instance of another "WindowsMT4" class.

It looks like the "Windows" class is initialized out of time.

 

I found the cause. Andrei helped. I did the singletons wrong.

XP and Vista initialize classes differently. You need the right singletons.

 
Zhunko:

I found the cause. Andrei helped. I did the singletons wrong.

XP and Vista initialize classes differently. You need the right singletons.


That's so gross. That's just awful!
 
C-4:

That's a real bummer. That's just awful!
Oh, come on... :-)) Just converted a class with static methods to singleton. Everything works.
 
Zhunko:
Yeah, okay... :-)) Just converted a class with static methods to singleton. Everything works.

Question for the superprofessional to share their experiences:)) - how do you remove a singleton?

 
alsu:

Question for the superprofessional to share their experiences:)) - how do you remove a singleton?

You mean clear the resources? In the destructor you can.
 
Zhunko:
What do you mean clear resources? You can in the destructor.

No, in the sense of removing the object itself - what procedure decides when to remove it?

I don't have any practical purposes at the moment, I just remembered that once I was doing a project, which used several singleton templates - so, there were always problems with the moment of singleton removal - I had to make some troubles with reference tracing, destructor wrapping in wrappers and so on... And when, for example, one of the modules crashed due to an exception, it was a mess... As a result, that was the last time I messed around with singletons, as it seemed to me to be much more of a hassle than a benefit)) Maybe I'm wrong.

 
alsu:

No, in the sense of removing the object itself - what procedure decides when to remove it?

I don't have any practical purposes at the moment, I just remembered that once I was doing a project, which used several singleton templates - so, there were always problems with the moment of singleton removal - I had to make some troubles with reference tracing, destructor wrapping in wrappers and so on... And when, for example, one of the modules crashed due to an exception, it was a mess... As a result, that was the last time I messed around with singletons, as it seemed to me to be much more of a hassle than a benefit)) Maybe I'm wrong.

Learned singletons recently. I've learned that I can't do without them. I don't know how to delete. Didn't need to.
 

alsu:

As a result, that was the last time I messed around with singletons, as it seemed to me to be a lot more hassle than it was worth.) Maybe I'm wrong.

If you're having trouble removing a singleton, it's probably not being used correctly. Although singletons are different too, take phoenix for example.
Reason: