Click here to Skip to main content
15,889,909 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: c+ + coding Pin
CPallini24-May-21 20:00
mveCPallini24-May-21 20:00 
QuestionOptimizing this code ? Pin
Duc Axenn24-May-21 0:56
Duc Axenn24-May-21 0:56 
SuggestionRe: Optimizing this code ? Pin
Richard MacCutchan24-May-21 0:02
mveRichard MacCutchan24-May-21 0:02 
GeneralRe: Optimizing this code ? Pin
Duc Axenn24-May-21 0:56
Duc Axenn24-May-21 0:56 
SuggestionRe: Optimizing this code ? Pin
Randor 24-May-21 2:30
professional Randor 24-May-21 2:30 
GeneralRe: Optimizing this code ? Pin
Duc Axenn24-May-21 4:21
Duc Axenn24-May-21 4:21 
GeneralRe: Optimizing this code ? Pin
Duc Axenn24-May-21 8:36
Duc Axenn24-May-21 8:36 
GeneralRe: Optimizing this code ? Pin
Randor 24-May-21 14:30
professional Randor 24-May-21 14:30 
Hi,

The only problem I see this new code snippet is that NumberOfDiskExtents is DWORD (unsigned long) and your for-loop conditional is signed. It's not a big deal but code reviewers might reject it. You didn't show us the definition of your GetInterfaceType() function but I have guessed it just does the STORAGE_PROPERTY_QUERY and returns the STORAGE_BUS_TYPE.

I did see some other issues in your original top post but I refrained mentioning them. You should avoid mixing TCHAR with both CString and LPCWSTR but rather choose Unicode or MBCS and use the same character set throughout your entire project when possible.

Text and Strings in Visual C++[^]

Duc Axenn wrote:
Do you think it's ok now?
Yes, it works. I compiled it and it found my SATA and NVMe volumes.

Duc Axenn wrote:
I'm very dumb to didn't see it at the beginning.
You seem like a fast learner, reading code that Raymond Chen wrote; understanding what it does and then extended it. That's fantastic for a beginner. Congratulations and keep up the good work.

Best Wishes,
-David Delaune
GeneralRe: Optimizing this code ? Pin
Duc Axenn24-May-21 20:41
Duc Axenn24-May-21 20:41 
GeneralRe: Optimizing this code ? Pin
Randor 25-May-21 12:25
professional Randor 25-May-21 12:25 
GeneralRe: Optimizing this code ? Pin
Duc Axenn26-May-21 2:53
Duc Axenn26-May-21 2:53 
QuestionCloud Storage Pin
Bram van Kampen23-May-21 15:10
Bram van Kampen23-May-21 15:10 
AnswerRe: Cloud Storage Pin
Victor Nijegorodov23-May-21 22:06
Victor Nijegorodov23-May-21 22:06 
GeneralRe: Cloud Storage Pin
Bram van Kampen29-May-21 14:49
Bram van Kampen29-May-21 14:49 
AnswerRe: Cloud Storage Pin
Gerry Schmitz24-May-21 7:14
mveGerry Schmitz24-May-21 7:14 
GeneralRe: Cloud Storage Pin
Bram van Kampen29-May-21 14:56
Bram van Kampen29-May-21 14:56 
AnswerRe: Cloud Storage Pin
Maximilien25-May-21 2:58
Maximilien25-May-21 2:58 
GeneralRe: Cloud Storage Pin
Bram van Kampen10-Jun-21 14:00
Bram van Kampen10-Jun-21 14:00 
Question32 and 64 bit versions of the same project Pin
Richard Andrew x6415-May-21 16:36
professionalRichard Andrew x6415-May-21 16:36 
JokeRe: 32 and 64 bit versions of the same project Pin
Peter_in_278015-May-21 17:00
professionalPeter_in_278015-May-21 17:00 
GeneralRe: 32 and 64 bit versions of the same project Pin
Member 1520359919-May-21 5:05
Member 1520359919-May-21 5:05 
AnswerRe: 32 and 64 bit versions of the same project Pin
Dave Kreskowiak15-May-21 18:10
mveDave Kreskowiak15-May-21 18:10 
AnswerRe: 32 and 64 bit versions of the same project PinPopular
Victor Nijegorodov15-May-21 21:25
Victor Nijegorodov15-May-21 21:25 
GeneralRe: 32 and 64 bit versions of the same project Pin
Richard Andrew x6416-May-21 1:11
professionalRichard Andrew x6416-May-21 1:11 
AnswerRe: 32 and 64 bit versions of the same project Pin
K Personett18-May-21 13:11
K Personett18-May-21 13:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.