Click here to Skip to main content
15,351,229 members

Comments by Dev O'Connor (Top 57 by date)

Dev O'Connor 5-Dec-17 4:27am View
   
+1 @Peter_in_2780 - spot on advice - worked a treat
Dev O'Connor 24-Aug-16 7:13am View
   
Spot on, exactly what i wanted to achieve. Really apprecaite the help 5+ for me :)
Dev O'Connor 9-Jun-16 6:43am View
   
I have tried without the decorated names but only works with decorated calls but then i get the AccessViolation.

I have tried writing a wrapper for this DLL several times but C++ i do not know, i dont know the syntax, structure or how it is laid out. i dont know how to reference the class object or instantiate them (never used C++ before)

THis is why i tried with the marshalling but that doesnt work. do you know any services that i could supply this information to that could write it for me (even if its paid for) becuase ive spent over a week on this already and getting nowhere fast.
Dev O'Connor 18-Sep-15 4:14am View
   
Sorry, didnt realise that was what you was meant to do. I hate having 'unanswer' questions on my profile, irritates me. Ill make sure to improve solution next time.
Dev O'Connor 17-Sep-15 17:20pm View
   
Yes, this would be the best way, you can either reference them either via the local directory of the server itself (if you upload to the same site your site is hosted on) or you can reference the src to the URL of the uploaded file.

Both will be sufficient.
Dev O'Connor 17-Sep-15 17:12pm View
   
If your machine are networked, try using a network share directory and use impresonation within ASP that has sufficient permissions to that directory then have the client web page reference the shared folder?

For obvious security concerns, you cannot access Far end resources from the server, otherwise all hackers would do it :)
Dev O'Connor 17-Sep-15 17:09pm View
   
Did the same thing before, i posted a queston claiming a split of an array was calculating wrong, only to realise i solved it before i posted it and posted a working solution! doh!
Dev O'Connor 17-Sep-15 16:23pm View
   
Lol.... i checked back over the outputs, it used to be 8 and i didnt realise it had changed!! sorry about that
Dev O'Connor 9-Sep-15 18:08pm View
   
Hi Maciej,

Thanks for the comment, i was hoping to avoid this due to this record type has 337 columns, as well as 160 repeated 'OCCURS' PIC's which will be sent off to a child table when inserted.

Which means i would have to classify each column and then pass the value, was kinda hoping i could just declare them and fill down some how such as COBOL does.

THanks anyway, i have something similar to this already and it becoming unmanagable as this is just one record time i have a whole bunch more and many more columns to declare and fill.
Dev O'Connor 22-Jul-15 5:37am View
   
Thanks for this, this has been a great help.
Dev O'Connor 7-Jul-15 17:39pm View
   
thanks again, dont suppose you used TCL before it has a DDe module for grabbing services but cant get it working
Dev O'Connor 7-Jul-15 16:35pm View
   
Thanks ill have a read, is there no way that you know to list all service/topic names open / in use ? any windows API?

the program is already writen and performs as expected on my current software however the software is being changed which is out of my control and need to update the service/topic pair name

Thanks for responding.
Dev O'Connor 7-Jul-15 15:43pm View
   
Unfortunately i need to scrape the screen values from a VT420 / VT220 display, nDDE is the only way i know how to do this.

If could shed any light on another solution or a way to achieve the above.

i admit its not a great way to do things but i have no way to trap the on screen information as it stands
Dev O'Connor 18-Jun-15 12:23pm View
   
Please mark the answer as the solution if this has resolved your question.

Thank you
Dev O'Connor 18-Jun-15 12:21pm View
   
Please mark the answer as the solution if this has resolved your problem.
Dev O'Connor 18-Jun-15 7:17am View
   
Ah sorry i get you now. Misunderstood you

I have update the solution for you in C#

Add Me.TopMost = True, that should sort it
Dev O'Connor 18-Jun-15 7:12am View
   
Form frm = new MyFormName();
frm.Show();
Dev O'Connor 18-Jun-15 7:12am View
   
Form frm = new MyFormName();
frm.Show();
Dev O'Connor 18-Jun-15 7:10am View
   
Try this:

Dim frm as Form = New MyFormName
frm.Show()
Dev O'Connor 18-Jun-15 6:44am View
   
Please provide your code you are using to try and open the window.
Dev O'Connor 18-Jun-15 6:12am View
   
Ok give me a mo
Dev O'Connor 18-Jun-15 6:11am View
   
What format is your Data Source in? Dataset? DataTable? SQL/ODBC DataReader?
Dev O'Connor 18-Jun-15 6:07am View
   
http://www.codeproject.com/Questions/1002110/EventLog-WriteEvent-Add-Data-Name-Attribute-to-Eve
Dev O'Connor 18-Jun-15 6:00am View
   
Thanks, will do :)
Dev O'Connor 17-Jun-15 17:07pm View
   
So i have managed to get the multiple data tags by creating it using EventEntry

<pre lang="vb">EventLog.WriteEvent("MySource", New EventInstance(0, 0, EventLogEntryType.Error), {1, 2, 3, 4, 5})</pre>

Do you know how to give the Tags names now as

<pre lang="text">
<eventdata>
1
2
3
4
5

Dev O'Connor 17-Jun-15 17:03pm View
   
So i have managed to get the multiple data tags by creating it using EventEntry

EventLog.WriteEvent("MySource", New EventInstance(0, 0, EventLogEntryType.Error), {1, 2, 3, 4, 5})

Just trying to get the Name attribute inside the data tag now, any thoughts>
Dev O'Connor 17-Jun-15 15:41pm View
   
Thanks for the response, I am currently already inputting the data in to event viewer with the above method, but when i am trying to create a custom view and using XML filtering you cannot filter down on an XML element as you cant use wildcards so i cannot find data within it so i cant fine "HIJ" within an XML element.

DO you have any other thoughts.
Dev O'Connor 15-Jun-15 17:29pm View
   
Hi, so i have managed to achieve this by grabbing the users token and using this to fire the exe, all is working as expected, once i have cleaned up the code from testing i will post an update below.

Due to grabbing the token, which requires the SE_TCB_NAME privelige the service is having to run as Local Service, when i try and grab the windows identity and check WindowsPrincipal.IsInRole, they all return false. Is this becuase the service is running as LocalService? Is there any way i can check if the passed 'SID' / WindowsIdentity to return the users group membership?

they all return false for local groups to the machine and to domain groups - basically i need it not to action this for administrator accounts (elevated access causes a problem with the actual applicaiton being called due to being able to see all of the processes for all users)
Dev O'Connor 15-Jun-15 17:29pm View
   
Hi, so i have managed to achieve this by grabbing the users token and using this to fire the exe, all is working as expected, once i have cleaned up the code from testing i will post an update below.

Due to grabbing the token, which requires the SE_TCB_NAME privelige the service is having to run as Local Service, when i try and grab the windows identity and check WindowsPrincipal.IsInRole, they all return false. Is this becuase the service is running as LocalService? Is there any way i can check if the passed 'SID' / WindowsIdentity to return the users group membership?

they all return false for local groups to the machine and to domain groups - basically i need it not to action this for administrator accounts (elevated access causes a problem with the actual applicaiton being called due to being able to see all of the processes for all users)
Dev O'Connor 15-Jun-15 4:55am View
   
Hi,

The idea is that the service will call another EXE under the users context, the service exe will only monitor that the processing EXE is running as that user, if not, start it as that user. GPO block access to cmd prompt and task manager and other monitoring applications so the users cannot terminate the task, its merely if it doesnt auto start or crashes that causes the problem but i dont want 50/60 instances of the monitoring application running when RDS is at full capacity.
Dev O'Connor 15-Jun-15 4:25am View
   
Hi,

the windows service will not need to interact, but it will call an application (if not running) as the user, taht will interact with the users desktop such as GetForeGroundWindow() and it also interfaces with a VT420 session for searching for specific parameters / terms / window positions forming a part of PCI compliance.

Processes are fine and can be monitored but the called EXE will need to be able to interact with the desktop which i assume wouldnt be a problem?
Dev O'Connor 15-Jun-15 3:41am View
   
Hi,

Thanks for the infor thats great, it was VBNET but no problem, i already have the code its the select statement i was struggling with.

Based on the Reply from Dave Krekowiak below, would the application be inhibited from interacting from the desktop (i dont need the user to interact with the application)
Dev O'Connor 15-Jun-15 3:40am View
   
It's not a program tht they need to interact with, its an application that that interacts with their desktop with windows api calls sich as GetForegroundWindows().

Will the same restriction be applicable here?
Dev O'Connor 12-Jun-15 10:58am View
   
Hi, Thanks for coming back to me, as there will be approx 50/60 users on this i dont want 50/60 users running the same EXE at the same time.

I am struggling to find the WMI tables etc required to get this information. If i can get the session id of the users then i can use WTSQueryUserToken or something a long this line but just cant seem to enumerate the users

would appreciate any pointers for WMI table?
Dev O'Connor 11-May-15 6:24am View
   
hi,

Unfortunately the front end applications are out of our control in terms of the way they process data, we just have a SQL file that it is used by the receiving application to get data from the first application.

So currently we are +01:00 due to DST, UTC is +00:00 currently, i assume on 25th October 2015 when UK DST reverts, the SQL i used above will use the other CASE: 00:00:00

Appreicate you responding.
Dev O'Connor 23-Apr-15 10:37am View
   
So i have managed to get most of the code back working after some misalignment causing some windows to lose focus etc.

I am still grabbing the main handle of the window that i want to query however when the value is:
GetControlId(FocusedControl(Me.Handle))
It returns the name of the control that has the focus however as i do not have a form in my code, i cannot use My.Handle.
When i use either of the following:

GetControlId(FocusedControl(Process.GetCurrentProcess.Handle))
GetControlId(FocusedControl(Process.GetCurrentProcess.MainWindowHandle))

It then will not return any values, just a blank string.

Would appreciate if you could shed some light on how to get the handle i need to pass through to this function or weather i am going to need to run the code on a form with the visibility set to False
Dev O'Connor 22-Apr-15 16:19pm View
   
Yes, i have reviewed both yours and Richards answers and both of them will help me achieve what i am looking to achieve, appreciate your time.
Dev O'Connor 22-Apr-15 16:14pm View
   
Hi, yes it is grabbing the control from another process. i will look further into this then, if you have any VB.net code samples i would be greatly appreciated
Dev O'Connor 22-Apr-15 16:04pm View
   
The application i am currently making interfaces two peices of software (bridge) so when a certain field / action is entered then another action needs to take place on the other software.

We have spoken to them and they have confirmed they will not make the code changes to interface the two peices of software so .... here we are lol!
Dev O'Connor 22-Apr-15 10:32am View
   
Yes i agree, i didnt think it would be possible but if you dont ask.. lol
Dev O'Connor 22-Apr-15 10:30am View
   
I was contemplating it however i would need the application to run as the logged in user not as system which is why i havent explorered this avenue as the computers are hot desk so the same user may not be sat at the same desk day in day out.
Dev O'Connor 22-Apr-15 9:57am View
   
This is an internal program (in a domain for employee monitoring) not for public release so the users should have access to terminate certain programs.
Dev O'Connor 22-Apr-15 9:42am View
   
Normally me too however i need to be able to create a program that cannot be stopped or at least restarted instantly.
Dev O'Connor 22-Apr-15 9:03am View
   
Thanks, i thought that would be the case but i thought i would check first.

Fortunately i have managed to identify something in our AntiVirus rules in the company, which is to prevent termination of certain processes. Going to try this but if this doesnt work i will revert back to creating two processes.

Thanks very much.
Dev O'Connor 21-Apr-15 14:41pm View
   
Of course!, Didnt think to check the other methods attached to WriteEntry.

Appreciate it.
Dev O'Connor 21-Apr-15 11:21am View
   
Hi Richard,

Apologies, i stripped out sensetive information but missed that one, i have updated it now with MyEvtLog

I understand its a shared member and cannot be used as such however my issue is here, is i want to be able to write that full event log entry... but to a remote machine not my local machine but if i use the 'EventLog' class it results in writing to my local event log which is what i need to avoid.
Dev O'Connor 19-Apr-15 17:24pm View
   
Thank you for the info i will have a read of this.

I have never setup configuration files in this way before so new ground for me so i would appreciate any help you can give on this.

I have read a document and implemented sort of what i want, i have the class built and used a TypeConverter which outputs it as <settingname>1,1,1 but i would prefer it in more readable format with the different XML steps.

With it i override CanConvertFrom, ConvertFrom and ConvertTo but would like to have it in the format above.
Dev O'Connor 19-Apr-15 17:07pm View
   
Appreciate you helping me with this.
Dev O'Connor 19-Apr-15 17:06pm View
   
Hi There,

What i want to achieve this kind of format in my config file as follows:
< settingname>
<DDERow>
<DDECol>
<DDELength>
<!-- settingname-->

and i want to be able to access it via the normal My.Settings namespace so:

My.Settings.SettingName.DDERow
My.Settings.SettingName.DDECol
My.Settings.SettingName.DDELength

Dev O'Connor 30-Dec-14 4:13am View
   
Doh!! sometimes the simplest things. Most of the forms only have a couple of controls however just a couple have quite a few, i dont want to implement threading for a small minority and it is simply for a second or 2 but the form moves whilst its loading so users can see its loading but i know when its deployed the users wont be as careful as they should be rapidly clicking etc which of course causes the error mentioned above...

Thanks for the reminder of DoEvents, i know DoEvents is a kinda dirty way to do it but for simplicity ill use it as i dont want to have to deploy a threading model within my application for just a small minority of forms.
Dev O'Connor 16-Oct-14 17:39pm View
   
Hi Sergey

I have tried repeated times to get this going to no avail i have tried Private Sub New() with no code and several other procedures

please could you use the code above and demonstrate an example so i can work from it as i do not understand the logic, you cant make a class private as then its not visible outside the class and its driving me nuts at the minutes.

Really appreciate any help you can give.
Dev O'Connor 16-Oct-14 17:15pm View
   
I clicked on it but it posted it as a solution

is it something along the lines of:

Private Sub New()
End Sub
Dev O'Connor 16-Oct-14 13:03pm View
   
I want the class to be available from the Main Class
As in MyCls.CustomerInfo - i dont want them to call the sub class directly as i did above.

I have asked sergey as i do not know how to create a private default constructor, i have researched this but just simply dont understand it. Would you be able to show me by way of copying my code above and adapating it to have a private constructor please as i am losing the plot here.

Many Thanks
Dev O'Connor 16-Oct-14 12:55pm View
   
Just to add when i make the var Private i can then no longer access:
MyCls.CustomerInfo
Dev O'Connor 16-Oct-14 12:54pm View
   
I want the Var 'CustomerInfo' to be available, what i dont want it to allow s to instantiate the subclass directly, such as:

Dim MyCls as MyClass1.clsClientInfo

i only want them to be able to use
Dim MyCls as MyClass1

Then they can use for example
MyCls.CustomerInfo.AccountNum = 123456789
Dev O'Connor 16-Oct-14 12:44pm View
   
But again as it stands, when i go to initiate the main class and following it with a . my subclasses show up and i dont want them to be able to instantiate them directly i only want them visible from the main class.
Dev O'Connor 16-Oct-14 12:43pm View
   
Hi
i am trying to do the following:

the class i have will have over 100 properties and i am trying to group them into subgroups by way of creating a subclass.

So the main class Creates a public var as the subclass which contains the properties.

this is a large development project and need to find a way to catagorise my properties into manageble groups.