Click here to Skip to main content
15,886,026 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: Can not create object of DirectorySearcher class with Visual C++ with project reference of System.DirectoryServices.dll Pin
Alex Banar1-Apr-22 6:22
Alex Banar1-Apr-22 6:22 
GeneralRe: Can not create object of DirectorySearcher class with Visual C++ with project reference of System.DirectoryServices.dll Pin
Richard MacCutchan1-Apr-22 6:28
mveRichard MacCutchan1-Apr-22 6:28 
GeneralRe: Can not create object of DirectorySearcher class with Visual C++ with project reference of System.DirectoryServices.dll Pin
Alex Banar1-Apr-22 6:49
Alex Banar1-Apr-22 6:49 
Questionrunning Powershell from ASP.NET Core 6 Pin
Johannes B. Latzel18-Mar-22 2:20
Johannes B. Latzel18-Mar-22 2:20 
AnswerRe: running Powershell from ASP.NET Core 6 Pin
Dave Kreskowiak27-Mar-22 18:17
mveDave Kreskowiak27-Mar-22 18:17 
QuestionC# TcpListener listen forever Pin
Goga Work11-Mar-22 18:42
Goga Work11-Mar-22 18:42 
AnswerRe: C# TcpListener listen forever Pin
Pete O'Hanlon11-Mar-22 20:57
mvePete O'Hanlon11-Mar-22 20:57 
QuestionPower BI Embedded : Cant doCross Filtering selecting multiple rows on a table visual pressing CTRL Pin
Member 155547063-Mar-22 17:19
Member 155547063-Mar-22 17:19 
Questionhow it works Pin
Calin Negru17-Feb-22 8:48
Calin Negru17-Feb-22 8:48 
QuestionRe: how it works Pin
Calin Negru17-Feb-22 10:41
Calin Negru17-Feb-22 10:41 
AnswerRe: how it works Pin
jschell17-Feb-22 10:44
jschell17-Feb-22 10:44 
AnswerRe: how it works Pin
Richard MacCutchan17-Feb-22 21:35
mveRichard MacCutchan17-Feb-22 21:35 
GeneralRe: how it works Pin
Calin Negru18-Feb-22 2:17
Calin Negru18-Feb-22 2:17 
QuestionPlease help with dynamic objects modeling Blazor/MVC Pin
Guillermo Perez28-Jan-22 13:53
Guillermo Perez28-Jan-22 13:53 
AnswerRe: Please help with dynamic objects modeling Blazor/MVC Pin
Richard MacCutchan30-Jan-22 6:17
mveRichard MacCutchan30-Jan-22 6:17 
AnswerRe: Please help with dynamic objects modeling Blazor/MVC Pin
Richard Deeming30-Jan-22 21:48
mveRichard Deeming30-Jan-22 21:48 
GeneralRe: Please help with dynamic objects modeling Blazor/MVC Pin
Guillermo Perez31-Jan-22 11:01
Guillermo Perez31-Jan-22 11:01 
Question<pre>I Have an application that shows output of cpu utilization its memory used and current date and time in console application output now i want to store this 3 things in my database how can i store it?</pre> Pin
Member 154919019-Jan-22 22:06
Member 154919019-Jan-22 22:06 
AnswerRe: <pre>I Have an application that shows output of cpu utilization its memory used and current date and time in console application output now i want to store this 3 things in my database how can i store it?</pre> Pin
dan!sh 9-Jan-22 22:42
professional dan!sh 9-Jan-22 22:42 
AnswerRe: <pre>I Have an application that shows output of cpu utilization its memory used and current date and time in console application output now i want to store this 3 things in my database how can i store it?</pre> Pin
jschell17-Feb-22 10:46
jschell17-Feb-22 10:46 
QuestionIncorporating values directly (as is/bytewise) into a string Pin
primem0ver28-Dec-21 10:19
primem0ver28-Dec-21 10:19 
AnswerRe: Incorporating values directly (as is/bytewise) into a string Pin
primem0ver28-Dec-21 20:07
primem0ver28-Dec-21 20:07 
AnswerRe: Incorporating values directly (as is/bytewise) into a string Pin
trønderen29-Dec-21 1:21
trønderen29-Dec-21 1:21 
GeneralRe: Incorporating values directly (as is/bytewise) into a string Pin
Richard MacCutchan29-Dec-21 1:40
mveRichard MacCutchan29-Dec-21 1:40 
GeneralRe: Incorporating values directly (as is/bytewise) into a string Pin
trønderen29-Dec-21 9:28
trønderen29-Dec-21 9:28 
The common property between unions and common blocks is that they both provide to different users a common blob, telling: Here is a binary blob - interpret it any way you want!

Details in accessability are different; in C you may have somewhat better control over which modules have access to the union definition. And you have collected all the different interpretations of that binary blob in one place (at least until you start casting pointer types).

Yet, the basic concept is the same: A binary blob that can be interpreted in any way that the accessor would like to. Sure, it must be one of the alternatives in the union definition. Just like an interpretation of a Fortran COMMON block must be according to one of the alternative source code definitions that COMMON block in the modules that may access it.

You may argue that collecting the COMMON block definitions / union alternatives in a single place is an improvement. Yes, it is, but the basic idea of a binary blob providing multiple interpretations is the same.

You may argue that while any Fortran module might access that binary COMMON blob, only those C modules including the definition of the union, and knowing the address of (if you like: a pointer to) a union instance, this doesn't give any sort of protection against the uncontrolled interpretation of the binary blob.

Even Fortran COMMON block had some accessability control: You had not only the plain, anonymous COMMON blocks but also named COMMON blocks - sort of comparable to letting only selected modules #include the union type definition: If you didn't know the name of the blob, you didn't have access to it. Sure, it was a poor kind of protection, but lots of protection is based on the (lack of) knowledge of how to access it. C/C++ provides a somewhat better protection.

In this case, considering how easily any C pointer can be cast into a pointer of any other type - and note: the definition of the target type is arbitrary; it doesn't have to be any centrally managed type definition - the type control of C/C++ lies much closer to the weak Fortran type check than to that of C#.

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.