Questions tagged [shared]

In VB.NET, the Shared keyword is roughly equivalent to the static keyword used by many other languages.

In , the Shared keyword is roughly equivalent to the static keyword used by and many other languages.

For example, the following code snippet in VB.NET:

Public Class Foo
    Public Shared Bar As String
End Class

Is equivalent to the C#:

public class Foo
{
    public static string Bar;
}

Further Reading

OpenMP

In OpenMP, it corresponds to the status of a variable. In a parallel section, a SHARED variable will be shared by all the running threads, meaning they will all access this variable and could modify it simultaneously. It is the default status of every variable in a parallel section, apart from the iteration counters.

1404 questions
8
votes
1 answer

Using a global variable in a shared library

I am writing an application in C which used a global variable (a logfile structure). In my application I am loading shared libraries dynamically at runtime and I want to use a global variable pointing at the the same logfile structure to do logging…
herzrasen
  • 377
  • 4
  • 13
8
votes
3 answers

Using both .so and .dll on Windows

I am writing a program in windows in C++ in which users will be able to compile extensions in the form of dynamic-link libraries (windows), or shared object files (linux). On windows, you use the LoadLibrary function to load a dll. Is it possible…
Langley
  • 91
  • 1
  • 1
  • 3
8
votes
2 answers

Linux: How to get full name of shared object just loaded from the constructor?

On Windows, several arguments are passed to the DllMain constructor: BOOL WINAPI DllMain( __in HINSTANCE hinstDLL, __in DWORD fdwReason, __in LPVOID lpvReserved ); From hinstDLL I can get the fully qualified file name of the DLL…
user198702
8
votes
4 answers

Outlook Mapi access shared contacts

I want to import contacts from Outllok via Mapi. First step with standard contact is no problem: MAPIFolder contactObjects = outlookObj.Session.GetDefaultFolder(OlDefaultFolders.olFolderContacts); foreach (ContactItem contactObject in…
Tobias
  • 2,945
  • 5
  • 41
  • 59
7
votes
2 answers

Is it safe for multiple users to use a Git repo on a shared network drive?

We're using Eclipse (with the eGit plugin) and I want to host a repo on a shared network drive that several users have write access to. Can users all point at the same original repo (on the shared drive) or would it be better for each user to clone…
Geeb
  • 631
  • 8
  • 19
7
votes
3 answers

Cmake: linking shared library

I've done this before a couple of times, but somehow I'm stuck this time. I have an executable "myapp" and a own shared library "mylib". In my cmakelists I have the following: ADD_LIBRARY(mylib SHARED ${SOURCES_LIB}) INSTALL(TARGETS mylib…
goocreations
  • 2,938
  • 8
  • 37
  • 59
7
votes
2 answers

Shmget: Invalid argument. Why i get this error?

I get a "shmget: Invalid argument error" while i try to execute this part of code int *nFS, *spb, *cell1, shmid; key_t key = 5768; //i need a shared memory segment in which i can put 3 ints if ((shmid = shmget(key, (sizeof(int) * 3),…
Sicioldr
  • 543
  • 3
  • 7
  • 13
7
votes
5 answers

Can I reset a static/shared class?

I've got a shared class (static in C#) which mostly carries some settings data that any class in the application can read and sometimes write. Also there are some static properties which holds some internal states. Now I want to revert this class to…
dr. evil
  • 26,944
  • 33
  • 131
  • 201
7
votes
4 answers

Installed docker for desktop . i cant find shared folder options in settings

I installed docker for desktop windows. Created docker file and ran simple nodejs call. it works. Issue now is shared folder. There is no option in settings. Actually i dont see most options people see in them. Without shared folder its not easy to…
alex K
  • 81
  • 1
  • 1
  • 5
7
votes
1 answer

Shared Library in repository with visual studio

I'm new to Git version control. I just want each project to have its own repository. I created A Project(Shared Lib) in RepoA B Project(Shared Lib) in RepoB that has subtree of A C Project(Shared Lib) in RepoC that has subtree of A D…
Han Eui-Jun
  • 142
  • 1
  • 8
7
votes
2 answers

Declaring Shared MustOverride

So why isn't it allowed to have Shared MustOverride/Overridable members? Some argue that overriding is related to inheritance, which doesn't make sense in case of Shared members because there is no instantiation involved. Here is one example where I…
dotNET
  • 33,414
  • 24
  • 162
  • 251
7
votes
1 answer

Using Azure CDN with Shared Access Signatures

Im trying to incorporate Azure to store the majority of my files for an application. I want to upload these files to a private container and private blob in azure, and have those uploads copied through the Azure CDN to all of the other nodes (still…
SchaF
  • 83
  • 1
  • 7
7
votes
1 answer

Access Shared Network Folder

I need to access via VBA a folder hosted on a Network File Server. The folder is accessible in writing only via a Service Account (different from normal user accounts) for which I do have username and password. Via the UI I can see that folder and…
cfugge
  • 83
  • 1
  • 1
  • 6
7
votes
3 answers

PHP Shared Sessions across Domain

I have seen a few answers to this on SOF but most of these are concerned with the use of subdomains, of which none have worked for me. The common one being that the use of session.cookie_domain, which from my understanding will only work with…
bigstylee
  • 1,240
  • 1
  • 12
  • 22
7
votes
4 answers

List all shared folders from a network location

I want to list all the shared directories from a network server. To list directories from a shared network directory I used Directory.GetDirectories(@"\\server\share\") The problem is I want to list all folders on \\server. If I use the same…
CornelC
  • 4,974
  • 1
  • 21
  • 28