Create A System-wide Independent Universal Counter Object Primarily For Database Keys?

Apr 5, 2010

I would like to create/use a system-wide independent universal 'counter object' that can be called via COM in a thread-safe manner. The counter object will be passed an ID to identify which counter to return, handle the counting, 'persist' the count (occasionally), have reasonable performance (as fast as possible) perhaps capable of 1000 counts per second or better (1mS) and be accessible cross-process/out-of-process. The current count status must be persisted between object restarts/shutdowns.

The counter object is liklely to be a 'singleton' type object implemented in some form of free-threaded dictionary, containing maybe 10 counters (perhaps 50 max). The count needs to be monotonic and consistent, (ie: guaranteed unique sequential values).Each counter should have a few methods, like reset, inc, dec, set, clear, remove. As a luxury, I would like to have a variable-increment (ie: 'step by' value). To support thread-safefty, perhaps some sorm of critical-section or mutex call. It just needs to return a long/4byte signed integer.

I really want something that can be called from anywhere, including VBScript, so I figure COM is my preferred solution.The primary use of this is for database keys. I am unable to use autoinc or guid type keys and have ruled out database-generated counting systems at this point.I've spent days researching this and I have really struggled to find a solution. The best I can find is a free-threaded dictionary object that can be instantiated using COM+ from Motobit - it seems to offer all the 'basics' and I guess I could create some form of wrapper for this.

[Code]...

View 4 Replies


ADVERTISEMENT

Create A Universal Platform App With An Access Database?

Nov 8, 2011

Until recently I have been using net 2005 with distributing an app which uses an access database with getting data using recordsets

I decided it was time to upgrade so I got net 2010 & started using ADO.net with a dataadapter.

To my dismay I have found that my app will not run on all platforms, ie XP, Vista 32 & 64 bit, Windows 7 32 & 64 bit From another question I have been told

"If compiled to target AnyCPU, your program will fail to run in an x64 environment if it utilizes any ODBC database driver. In this case, you must compile it to x86. Therefore, x86 is safer than AnyCPU."

Which I have found to be correct I am not familiar with all the options to open a database & the respective code required to extract/change the database data. I also don't understand the implications of using x86 cpu instead of any CPU

MY net 2005 apps have been working fine for the last 6 years (until W7 64 bit), so I want to develop an app that has the same lifespan without having to make variations to the build for specific platforms

I would like the answers to the following:

1. is x86 the new standard for specifying cpu & works on all platforms?

2. why does W7 64 bit have a windows & windows x86 system folder

3. why does my installer when "any CPU" is specified install it in the x86 system folder (W7 64 bit, even though the app fails when trying to open the database as outlined above)

4. which method of opening an access database is preferred which works on all platforms with a common cpu specified?

View 14 Replies

Program To Create System Wide Hotkeys And Run At Background?

May 8, 2008

I am trying to write vb program that creates system wide Hotkeys and runs at the background. The hotkey is to enter system date in another application.

View 6 Replies

Error - LINQ To Entities Does Not Recognize The Method 'System.Object IIf(Boolean, System.Object, System.Object)'

Jul 29, 2011

I am getting following error whenever I want to use IIf function inside entity framework query.

LINQ to Entities does not recognize the method 'System.Object IIf(Boolean, System.Object, System.Object)' method, and this method cannot be translated into a store expression.

View 1 Replies

VS 2010 Create Dynamic/Universal Event?

Sep 8, 2011

I'm creating 10 web browsers at runtime, they are all in WBS() array and i need "navigated" event for all of them with ability to identify sender. Either 1 event for this array or event for all web browsers and then i would just check it they are the ones from array.

View 2 Replies

Method 'System.Object CompareObjectEqual(System.Object, System.Object, Boolean)' Has No Supported Translation To SQL.?

Apr 16, 2010

What do I need to convert?

Dim CEESearchByAppNo = From CEEsearch In dbCEE.tblScanneds _
Where CEEsearch.AppNo = iAppNo

[code].....

View 5 Replies

Capture System Wide Selectedtext

Sep 9, 2010

how can i capture system wide selectedtext?

i've managed so far to get a global mousehook + i'm hoping to capture the selectedtext from anywhere system wide when the user left clicks.

i tried using the keybd_event api to send CTRL+C to copy any selectedtext to the clipboard but it has unexpected effects + seems to run before the text i've just selected becomes selected.

here's the code i'm using:

Public Class Form1
Private Declare Function keybd_event Lib "user32" Alias "keybd_event" _
(ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Integer, _

[Code].....

View 5 Replies

Get System Wide KeyUp Event?

Jul 15, 2011

Currently I am able to see if a key is currently pressed via the GetAsyncKeyState function. Currently I just simply have a timer running in the background that constantly checks if a certain key is pressed in order to run a command. However my issue is if the user holds down the key it will continually run that bit of code over and over per timer tick. Is there a way or another function to detect a keyup or keypress only. This is my current code to detect keys:

Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Windows.Forms.Keys) As Integer Public ReadOnly Property CurrKey(ByVal key As Windows.Forms.Keys) As Boolean
Get Return CBool(GetAsyncKeyState(key))
End Get
End Property

View 1 Replies

Register F7 As A System Wide Hotkey?

Sep 15, 2009

How would I register F7 as a System Wide Hotkey?This is my timer code

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
SendKeys.Send(Keys.Space)
End Sub

When I start the timer, and open notepad, this is what i get

View 6 Replies

Create Code For Getting The Universal Naming Convention For Mapped Drive In VB6?

Jun 13, 2008

I have run across exam ples of how to create code for getting the universal naming convention for mapped drive in VB6 and access but that don't work in VB net.

View 4 Replies

VS 2008 System Wide Hotkey Stops Working?

Oct 11, 2010

Has anyone used a system wide hotkey and notice it no longer works? But the program is still running fine. When I run my program and it starts the hotkey, sometimes it will work fine all day, other times within 15 minutes I press the keys and the program does not react to it. I am using the keys Control-F2. Here is my

Public Sub SetHotkey()
Try
Select Case ComboBox2.SelectedIndex

[code]....

View 1 Replies

How To Implement A System Wide Text Replacement In Windows Programmatically

Dec 20, 2010

I have a small VB .Net application that, among other things, attempts to substitute system wide typed text by the user(hotstrings concept). To achieve that, I have deployed 'ahk2exe' and 'AutoHotkeySC.bin' with my application and did the following:When a user assignes a new 'hotstring':

Kill 'hotstring' exe script file if running Append new hotstring to the script file (if non exist then create a new one)Convert edited/new script file to exe (using ahk2exe)Run the newly converted script exe(somewhere there I also check if the hotstring has been already assigned)However, I am not totally satisfied with this method for the following two main reasons:

The extra resources deployed with the application. Lag: The time it takes for the system to kill the process and then restart it takes a minimum of 5 seconds on my fast computer and more on other computers. That amount of time is much more than the time it takes the user to assign the hotstring, minimize/close the window and then test his/her new hotstring. When the user does so initially with no success they will think the process failed. So this method is not very good for user experience.I am looking for a different method or implementation. May be using keyboard hooks? Or maybe adding a .dll library that achieves the same. Are there any resources you know about that might help (free or commercial)? What is the best way to achieve my desired goal?

View 1 Replies

Application Security: Counting Days Independent Of System Calander ?

Jun 10, 2011

Counting days independent of system calander ?

View 1 Replies

Application Security: Counting Days Independent Of System Calendar

Jun 10, 2011

I want to add a feature to my trial version of the application. After first activation, I want to make it limited to 90 days. But I am concerned about user's changing the date of system hence deceiving my application. Is there any possibility to make it fool proof in a way that even if user takes the calender back, application expires after 90 days of first activation? First activation date has been saved in the database.

View 2 Replies

Failure To Create Data Controls To Access Database Object Reference Not Set To An Instance Of An Object?

May 3, 2011

I was create Access database with Access 2003. I create VB project with Visual Studio 2005 Standard With connection wizzard I create coonect with this Access database, select all tablesI see this database inside Data sources and inside Server explorer Test connection is OK When I drag and drop table from Data sources, Wizzard don't create DataGridView, DataSourceBinding etc .. and I see popup window with mesage: Object reference not set to an instance of an object and then "game over"

View 2 Replies

Create A Shared Project Wide Variable

Aug 3, 2010

I've been looking at using PROPERTIES [URL] but frankly I don't understand it that well. Before I invest the time to read, understand, and truly comprehend this, I want to make sure it's the best way. My intended goal is to create my database connection string in a function/sub somewhere, then assign it to this project wide string variable, then I can use it in any form, project wide without having to recreate it.

[Code]...

View 7 Replies

Office Automation :: Method Not Found: Void Excel.Range.set_Value(System.Object,System.Object)

Mar 11, 2009

following error message:

Method not found: Void Excel.Range.set_Value(System.Object,System.Object)

View 4 Replies

VS 2010 Object Rotation And Move Object With Arrow Keys?

Feb 8, 2011

I want to learn how to rotate an object by direction and speed and also how to move an object using the arrow keys?

View 2 Replies

Transaction Counter Ticketing System?

Nov 23, 2011

i am just trying to learn vb cause a friend advised me that this thing could be a big help to me. I have learned the basic but unfortunately, it would take me weeks or months perhaps to master this thing. Am a bit hesitant cause am a little bit shy but am taking my chances.

We would like to have our own ticketing system wherein it would give a seperate continuous number for our Three counters. Like if a click a certain button asking them what to do, it would print,referring them to the counter and what number they are in the que.

View 12 Replies

Populate A Combox Box With Counter Object?

Feb 27, 2009

How do i populate the combo box with counter object like in add counter dialog box in Perfmon in Xp.bottom line is i would like to get a dialog box like in perfmon add counter

View 1 Replies

VS 2008 Object Reference Error On A Counter?

Dec 22, 2009

Under normal circumstances I am not TOO bad at trying to figure errors out. However, I can't seem to understand why I am getting the age ol' "Object reference not set to an instance of an object error" in this lil bit of code.

This is where I define my 'intTotalRecords'
Connection.Open()
Command.CommandText = "SELECT * FROM CompanyTable"

[code].....

View 3 Replies

Create Database Management System?

Feb 14, 2010

create database management system in vb 2008

View 2 Replies

Create Own System Date In .net Or Database Level?

Apr 10, 2011

i don't want to use the system date and time in my mini project.i want to create my own system date and time to be in sync with standard time i specify?

View 3 Replies

Php - Create A System That Is Connected A Website With The Same Database?

Feb 4, 2012

I have a thesis project. it is composed of a webpage created on php and a system using vb.net 2008. As of now , they are both connected to the same database. I am wondering if it is possible that if i packaged the system and live the website, will still be connected with one database?

View 1 Replies

Database - Create Model Container Object?

Sep 9, 2011

So I create the model container:

Private mdbContext As PFModelContainer
Private mdbTransactions As Object

Before I did it this way:

Private mdbContext As New PFModelContainer
Private mdbTransactions As mdbContext.Transactions

Thinking maybe I was doing something wrong I changed it over to the first way, then I do:

Public Sub New()
mdbContext = New PFModelContainer
mdbTransactions = mdbContext.Transactions
End Sub

Once I hit mdbContext = New PFModelContainer it takes me over to the PFModel.Designer.vb Where it steps through the following:

Public Sub New()
MyBase.New("name=PFModelContainer", "PFModelContainer")

At which point it terminates execution of the code. This is the error it gives me on the Immediate window:

A first chance exception of type 'System.ArgumentException' occurred
in System.Data.Entity.dll

Is there something I can do to make this error go away? I tried deleting the project and recreating it with my old .edmx model that I downloaded from Mozy from when it used to work. It stopped working (as far as I can tell) after I changed the .edmx model and updated it. Maybe I did something else in the other project too, but I'm not recalling anything.This is what is in the app.config:

<connectionStrings>
<add name="PFModelContainer" connectionString="metadata=res://*/PFModel.csdl|res://*/PFModel.ssdl|res://*/PFModel.msl;provider=System.Data.SqlServerCe.3.5;provider connection string="Data Source=|DataDirectory|inDebugMyDatabase#1.sdf"" providerName="System.Data.EntityClient" />
</connectionStrings>

Should I be referencing System.Data.EntityClient and System.Data.SqlServerCe.3.5 somewhere?The EDMX property Entity Container Name is PFModelContainer and the Namespace is PFModel.

View 1 Replies

Create A Database That Uses Object Dependencies For Five Different Related Tables?

Feb 9, 2011

I have trying to create a database that uses object dependencies for five different related tables.

View 1 Replies

Database - Blob Download Counter In .net?

Dec 9, 2009

I need to add a download counter to know how many times my BLOB data is read and displayed from the database (to determine traffic). How and where can I add this counter?

I have a dynamically generated list of links such as <a href="page.aspx?DocID=IDhere">Document filename</a> which direct to a display page.My display page code looks like:

Protected Sub Page_Load
Dim DocID As Integer = Convert.ToInt32(Request.QueryString("DocID"))
Dim connStr As String = conn string here

[code]....

View 1 Replies

VS 2010 - Unable To Cast Object Of Type 'System.String' To Type 'System.Object[]'

Jan 25, 2011

For I = 0 To 10
If Items.Count = 0 Then Exit For
Dim T As New Thread(AddressOf Thread)
T.Start(New Object() {"Test", "Test"})

[code]....

When I put same code in empty project it works.

View 5 Replies

Get The Object To Accept Two Different Keys At Once

May 2, 2011

i have a game with a moving sprite and it goes foward left back and right. i cant quite figure out how to get the object to accept two different keys at once and move in that direction in the code. ill attach my code,

[Code]...

View 1 Replies

VS 2010 System Keys Names?

Oct 11, 2010

What names / number of the following keys (marked in red):

View 13 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved