Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
N

normanordas

@normanordas
About
Posts
22
Topics
9
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • multiple asynchronous calls
    N normanordas

    hi guys can you help me with this one... I have a loop that calls on an asynchronous method call with callback. obviously, separate background worker threads from the thread pool will be assigned for each method call to manage the execution in parallel path. but i do worry on a number of things: 1. since the asynchronous method call is non-blocking then members of my method is not thread-safe (yaiks!) 2. if i lock the method using MethodImplAttribute or locking variants (synclock, monitor, mutex, etc...) then my asynchronous calls become useless (threads on-queue), i myt as well go back to synchronous calls. Questions: 1. Are asynchronous calls not thread-safe and non-blocking as i guess? 2. how can i execute thread-safe multiple asynchrounous method calls? what i mean is that each call to the single method by each separate threads should have its own instances/values. different threads should not interfere by altering the values set by other threads running in-parallel. in other words its like giving each thread a segment in the memory where to put its own private transaction with the method being called (private session). 3. are methods of remotable objects (methods of proxies in remoting) activated on the server on Singleton mode thread-safe? how does the remotable object handles simultaneous request from multiple asynchronous calls? i bet most of you have encountered the same dilemma. tnx a lot!

    Visual Basic question sysadmin data-structures performance help

  • Threading in Remoting
    N normanordas

    I have one method (GetRow) on the server (remotable object) that caters hundreds of simultaneous clients requests. How does the remotable object handles all this requests at the same time? Are they queued until one request is done or threads are created for each request? Are methods defined in a remotable object SYNCHRONIZED? Do threads process the same code inside GetRow method at tha same time? I was thinking that if the latter is the case then this is dangerous as data inside the method are arbitrarily changed.

    Visual Basic sysadmin question

  • Interrupt loop operation
    N normanordas

    How can i interrupt a loop operation? Example im iterating over all the records of a 100,000 datareader however i decided to cut short the iteration by clicking a Stop button. How do i do that?

    Visual Basic question tutorial

  • importing dll's
    N normanordas

    try adding an "alias" to your declaration, this alias should have the same name as the main subroutine in your app (you may follow this with A [for ANSI] or W [for ASCII]). you then invoke the routine thru this alias. another workaround is using the DLLImportAttribute becoz with this you can specify the entry point during declaration.

    Visual Basic csharp help visual-studio debugging

  • ByReference help
    N normanordas

    This is somewhat tricky so you be watchful with any changes that could occur.You might expect that since this is passed by reference any changes you made to the passed variable would reflect in the instanciated class.

    Visual Basic help question

  • Manipulating a hashtable
    N normanordas

    Hashtable belongs to readonly dictionary base object. Thu editing the content is not possible.what you can do ir remove the key and add it again with the new value: hashTab.Remove ptr.Key then... hashTab.Add ptr.Key, “something different”

    Visual Basic question announcement

  • MessageBox And MsgBox
    N normanordas

    Its a separate class, included jst for backward compatibility to VB6 developers.

    Visual Basic tutorial question

  • Random Navigation of a BindingContext ???
    N normanordas

    i have the same prob :(

    .NET (Core and Framework) question tutorial lounge

  • A question about Remoting
    N normanordas

    It might have worked but it doesnt seem to be the correct procedure. The next time you need the tcpchannel to listen again then you have to register it. Succedding calls mean registering and unregistering the channel and thats quite tedious process and surely wud entail performance penalty. Is there other way we cud do that?

    .NET (Core and Framework) question

  • Listview images question
    N normanordas

    As you know the images attached to your listview are also objects maintained by Image class. For this very reason the image is not automatically embed to you listview object nor to your image class. You keep the path intact the time you call it in your distributed apps by tracking the path of the source image. To avoid such error make sure your passing the correct image path(string value) :)

    .NET (Core and Framework) question csharp visual-studio help

  • Is it possible to make a setup .exe with .NET installer?
    N normanordas

    You should create a project whose type is a setup project. By doing so you can assign the files needed to get installed by using the filesystem editor(the area where you can see the application folders and the likes...). When you build the project it will create a setup.exe and its equivalent .msi file. Both are executable files :)

    .NET (Core and Framework) csharp question workspace

  • MSDE Usage
    N normanordas

    Download and run the file SQL2KDeskSP3a.exe file from msdn website. from your console prompt type "setup SAPWD=(Some password) SecurityMode=SQL" You are now ready to use MSDE as your database.

    Database database sql-server sysadmin question

  • More on DataSets
    N normanordas

    1. Are there any considerations when to use untyped and typed datasets? I find typed-datasets more useful and less error prone in typo since you can call the members exactly by the name itself besides the fact that it adds some useful methods not present in its counterpart. 2. What condition should stop me from using typed-datasets? Are there limitations? 3. Does datasets supports concurrency..i.e. move the record pointer forward, backward, BOF and EOF? How about bookmarks?

    Database css help question

  • On-the-fly description of custom method.
    N normanordas

    Ah ok :) sorry i didn't noticed my previous post has replies already. Tnx a lot.

    Visual Basic question

  • On-the-fly description of custom method.
    N normanordas

    Hi guys, How can i create my own description of the method i defined in my class such that when i call this method a TOOLTIP will come out exposing the Description i wrote for that particular method. Just like the members of any class in any assembly. When you press period (.) the members will come out and a tooltip will be displayed categorically showing the signature, return type and purpose for this method. Tnx a lot!

    Visual Basic question

  • Documentation design
    N normanordas

    Hi Guys can you help me with this: 1. How can I create an on-the-fly documentation generation for my codes so that when i compile my application the documentation is written in an html file? 2. How can i create my own description of the method i defined in my class such that when i call this method a TOOLTIP will come out exposing the Description i wrote for that particular method. Just like the members of any class in any assembly. When you press period (.) the members will come out and a tooltip will be displayed categorically showing the signature, return type and purpose for this method. Tnx a lot!

    Visual Basic question html design help

  • Pass by Value or by Reference
    N normanordas

    Using P/Invoke how would i know that i should be passing "by value" or "by reference" to the arguments of a method or function of the DLL? 2. Equivalent type in .Net of the used data type for each variable (e.g what's the equivalent type of BSTR in VB.Net/C#? 3. In the type library it says: VARIANT_BOOL _stdcall NE_QueryElementByID( [in] long net, [in] ElementTypeEnum eltype, [in, out] IDAttRec* id, [in, out] HandleAttRec* h); This is the way i called it in VB.Net...is this correct? ... _ Public Shared Function NE_QueryElementByID(ByRef net As Long, ByRef eltype As ElementTypeEnum, ByRef id As IDAttRec, ByRef h As HandleAttRec) As Boolean End Function ... Dim h1 As HandleAttRec hi.Handle = 0 Dim id1 As IDAttRec Dim m_startid As Int32 = 4424 id1.UserID = 99 id1.LayerKey = 1 dim bol as Boolean = NE_QueryElementByID(net, ElementTypeEnum.NE_EDGE, id1, h1) Tnx a lot!

    COM csharp question

  • wrapping .TLB to .DLL for .NET
    N normanordas

    This is content my my type-library when i open it thru OLE Viewer: // typelib filename: neteng.tlb [ uuid(281078B0-B4B9-11D2-92C7-0000F878079B), version(1.2), helpstring("Library Neteng"), helpfile("NetEngine.HLP"), helpcontext(00000000) ] library NETENG { // TLib : // Forward declare all types defined in this typelib typedef enum { NE_READWRITE = 0, NE_READONLY = 1 } AccessModeEnum; typedef enum { NE_SIMPLE = 0, NE_FASTINDEX = 1 } IndexTypeEnum; [ dllname("neteng.dll") ] module NETENGAPI { [entry(0x60000000), helpstring("Initialize the network engine."), helpcontext(0x0000756f)] void _stdcall NE_InitNetworkEngine(); [entry(0x60000001), helpstring("Exit from the network engine."), helpcontext(0x00007570)] void _stdcall NE_ExitNetworkEngine(); [entry(0x60000002), helpstring("Takes in the public attribute record for the Network and creates a Network. This results in a directory whose name is part of the Network attribute record. The Network remains until deleted. A NULL pointer is returned if the Network could not be created."), helpcontext(0x00007573)] ------------------------------------------------------------- as you can see my neteng.tlb file has a module NETENGAPI but what i don't understand is the inclusion of [dllname("neteng.dll")]. Does it mean that the functionality of the NETENGAPI module resides in another file and that is neteng.dll? Indeed there's another fle associated with it but i can't open it by OLE Viewer it says its not a valid type lib. How i can i use NETENGAPI then in my VB.Net app?Adding reference to neteng.tlb only shows the enumeration members but the module methods can't be called nor recognized(NETENG.NETENGAPI.NE_InitNetworkEngine() is not a member the editor says). Tnx a lot!

    C# com csharp sysadmin performance

  • wrapping .TLB to .DLL for .NET
    N normanordas

    I have a .tlb file(neteng.tlb) that works on a vb 6 program. This library has module-based methods that i can call anywhere and it works fine. Next I wrapped this module-based DLL(neteng.tlb) to another VB 6 COM as you have said. I did that by adding a referenced first to "neteng.tlb" library then adding the following code to the class (NETENGAPI is a module inside "neteng.tlb"): '------------------------------------ Option Explicit Public Function NE_IsNetwork1(name As String) As Boolean NE_IsNetwork1 = NETENGAPI.NE_IsNetwork(name) End Function Public Function NE_OpenNetwork1(name As String, mode As AccessModeEnum) As Long NE_OpenNetwork1 = NETENGAPI.NE_OpenNetwork(name, mode) End Function Public Sub NE_InitNetworkEngine1() Call NETENGAPI.NE_InitNetworkEngine End Sub Public Sub NE_ExitNetworkEngine1() Call NETENGAPI.NE_ExitNetworkEngine End Sub '------------------------------------ Then save the file as Netengs.DLL (class name is NetEngEng) ===>>> Process Flow: neteng.tlb wrapped inside ->netengs.dll Note: Netengs.dll purpose was to call those module-based methods inside neteng.tlb thru the class NetEngEng so we can expose them when we migrate it to .NET assembly code. I created another VB6 Prog to test netengs.dll if its gonna work (i add a referenced first to netengs.dll). See code below:. Option Explicit Dim shp As String Dim net As NetEngs.NetEngEng Private Sub Form_Load() Set net = New NetEngEng Call net.NE_InitNetworkEngine1 shp = "d:\tracking\shapes\roadcenter_mkt_only.nws" 'Dim net As New NetEngs.NetEngEng Dim bool As Boolean 'bool = net.NE_IsNetwork1(shp) bool = net.NE_IsNetwork1(shp) If bool Then MsgBox ("Is network") Else MsgBox ("Is not network") End If Dim ne As Long ne = net.NE_OpenNetwork1(shp, 1) If (ne = 0) Then MsgBox "Network " + shp + " not found.", vbCritical Exit Sub End If Call net.NE_ExitNetworkEngine1 End Sub '----------- but when i run the prog and it step into the code Call net.NE_InitNetworkEngine1 it raises this error: The instruction at "0x00001de2" referenced at "0x00001de2". The memory could not be "read." My neteng.dll that wraps neteng.tlb don't even work inside another vb 6 prog. Whats wrong with neteng.dll here? Am i missing something? It would be more disaster if i import this to interop assembly. Tnx!

    C# com csharp sysadmin performance

  • Calling COM methods from a module NOT ALLOWED?
    N normanordas

    Its not a COM control its just a COM file(neteng.tlb). I noticed there's two other file in the same installation directory of that DLL (neteng.lib and neteng_CB.lib). How are this files related to neteng.tlb COM file?Which file should i import using tlbimp.exe?Importing neteng.lib or neteng_CB.lib via tlbimp says its not a valid type library. But i can import neteng.tlb and and it can create an assembly. This is exactly the same COM i used in my vb 6 program. I noticed also that the interop assembly created for the COM doesnt show any existence of a class. Only the namespace name, structs and enums are shown. The module and its methods were not exposed. So how would i be able to call the methods of the module as part of the created interop assembly if in the first place i can't see them present in the created assembly? Many Thanx!

    C# csharp question asp-net com
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups