Click here to Skip to main content
16,005,038 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Regsvr32 failed - Invalid access to memory location Pin
leckey24-Jul-07 9:12
leckey24-Jul-07 9:12 
QuestionRight click on tree control will not select the item Pin
Shay Harel24-Jul-07 6:24
Shay Harel24-Jul-07 6:24 
AnswerRe: Right click on tree control will not select the item Pin
Mark Salsbery24-Jul-07 6:54
Mark Salsbery24-Jul-07 6:54 
GeneralRe: Right click on tree control will not select the item Pin
Shay Harel24-Jul-07 7:11
Shay Harel24-Jul-07 7:11 
Questionprocess monitroing Pin
vineeshV24-Jul-07 4:32
vineeshV24-Jul-07 4:32 
AnswerRe: process monitroing Pin
DevMentor.org24-Jul-07 21:24
DevMentor.org24-Jul-07 21:24 
QuestionDoubt on CString and BSTR LPWSTR Pin
Raj Prathap24-Jul-07 3:03
Raj Prathap24-Jul-07 3:03 
AnswerRe: Doubt on CString and BSTR LPWSTR Pin
CPallini24-Jul-07 4:14
mveCPallini24-Jul-07 4:14 
Raj Prathap wrote:
But the contents in that pointer are different. BSTR is a wide char string with length in the first byte.

Actually the length field is 4 bytes long.


Raj Prathap wrote:
BSTR bst = AllocSysString("bstr");

The above should be:
BSTR bst = SysAllocString(L"bstr");


Raj Prathap wrote:
The code works fine, and behaves as we expect.
My doubt is how at run time the decision on the first byte is decided? i.e whether the first byte is the data or the length?? how the compiler identifies

The trick is in SysAllocString that returs a pointer to the data string, not to the length prefix, see here http://msdn2.microsoft.com/en-us/library/ms221069.aspx[^] for a better explanation.

Smile | :)





If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

GeneralRe: Doubt on CString and BSTR LPWSTR Pin
Raj Prathap24-Jul-07 19:29
Raj Prathap24-Jul-07 19:29 
GeneralRe: Doubt on CString and BSTR LPWSTR Pin
CPallini24-Jul-07 20:19
mveCPallini24-Jul-07 20:19 
AnswerRe: Doubt on CString and BSTR LPWSTR Pin
Nibu babu thomas24-Jul-07 4:14
Nibu babu thomas24-Jul-07 4:14 
AnswerRe: Doubt on CString and BSTR LPWSTR Pin
led mike24-Jul-07 4:22
led mike24-Jul-07 4:22 
AnswerRe: Doubt on CString and BSTR LPWSTR Pin
Michael Dunn24-Jul-07 15:13
sitebuilderMichael Dunn24-Jul-07 15:13 
Questionms office automation from NT service in 64 bit OS Pin
indra2024-Jul-07 1:55
indra2024-Jul-07 1:55 
QuestionAccess Voilation ... Pin
Programm3r24-Jul-07 1:48
Programm3r24-Jul-07 1:48 
AnswerRe: Access Voilation ... Pin
jhwurmbach24-Jul-07 2:15
jhwurmbach24-Jul-07 2:15 
AnswerRe: Access Voilation ... Pin
Cedric Moonen24-Jul-07 2:18
Cedric Moonen24-Jul-07 2:18 
QuestionRe: Access Voilation ... Pin
Programm3r24-Jul-07 2:33
Programm3r24-Jul-07 2:33 
AnswerRe: Access Voilation ... Pin
Cedric Moonen24-Jul-07 2:37
Cedric Moonen24-Jul-07 2:37 
GeneralRe: Access Voilation ... Pin
Programm3r24-Jul-07 2:42
Programm3r24-Jul-07 2:42 
GeneralRe: Access Voilation ... Pin
David Crow24-Jul-07 3:15
David Crow24-Jul-07 3:15 
QuestionRe: Access Voilation ... Pin
Programm3r24-Jul-07 2:40
Programm3r24-Jul-07 2:40 
AnswerRe: Access Voilation ... Pin
Cedric Moonen24-Jul-07 2:52
Cedric Moonen24-Jul-07 2:52 
GeneralRe: Access Voilation ... Pin
Programm3r24-Jul-07 3:15
Programm3r24-Jul-07 3:15 
QuestionDeclaring too many local variable in a function would affect the performance? Pin
Mushtaque Nizamani24-Jul-07 1:45
Mushtaque Nizamani24-Jul-07 1:45 

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.