|
i want to work with screen servers.
what is the name of the DLL should i work with ?
is it User32.dll?
and what's the name of the functions that should i use?
Militiaware
Faris Madi
|
|
|
|
|
To start the screensaver, take a look at this[^].
If you want to write a screen saver, take a look at this[^].
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
i created a DLL file - class lib.
how to lock the code and prevent the others to get my code.
Militiaware
Faris Madi
|
|
|
|
|
Write it again in C++. Sorry, I assume you used VB.NET, to have asked this, and that's your only option.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Like Christian said, if you want to protect the code, don't write it in any of the Managed languages, like VB.NET, C#, ...
You can make it more difficult to understand if you used an Obfuscator (one comes with Visual Studio.NET), but even the best obfuscator won't guarantee that the code can't be reverse engineered.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave Kreskowiak wrote: but even the best obfuscator won't guarantee that the code can't be reverse engineered.
Neither will writing it in C++
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
My Blog[^]
|
|
|
|
|
I kind of left that point out, didn't I?
But, it does make it more difficult than just opening Reflector and clicking on a method to decompile it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
okay...what about securing my control that i made.
i mean i created a control and give it to some one and i want to use it only not to get my code.
Militiaware
Faris Madi
|
|
|
|
|
Welcome to the dilema that every developer faces!
There is no answer for this.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am having real difficulty in opening a specific .XLS file from within Access.
I want to call my Excel file from Access to work with charts (templates) and then tweek the values of the charts based upon data from Access tables.
I used the Wizard to create the general subroutine and then tried to tailor it to open up my specific file - what I have below has SERIOUS problems when switch between worksheets in the .XLS file and the cursor opens as Hour-Glass until moved out of grid/cell area.
Any help on how to do this, where to look?
Thanks,
Johnny
Here is my code from Access VBA code:
Private Sub cmdRunExcel_Click()
On Error GoTo Err_cmdRunExcel_Click
Dim oApp As Object
Dim xlApp As Object
<br> <br>
Set oApp = CreateObject("Excel.Application")
Set xlApp = GetObject("C:\work\myDB_Charts.xls")
oApp.Visible = True
xlApp.Application.Visible = True
xlApp.Parent.Windows(1).Visible = True
<br> <br>
'Only XL 97 supports UserControl Property
On Error Resume Next
oApp.UserControl = True
<br> <br>
Exit_cmdRunExcel_Click:
Exit Sub
<br> <br>
Err_cmdRunExcel_Click:
MsgBox Err.Description
Resume Exit_cmdRunExcel_Click
<br> <br>
End Sub
|
|
|
|
|
I have been having trouble with Excel myself so I don't know if I can be of any help to you. My suggestion would be to try recording a macro of what you want to do. Copy and paste the code it generates into your subs and then tweak it to suit your needs. That got my program "close" to working but finding answers for Excel seems to be very difficult.
Hope this helps, Garner
|
|
|
|
|
Thanks for the suggestion - I didn't think about recording a macro.
I was able to get a working solution that is adequate for my needs. I basically followed the example that I found in the Object Browser's help for "GetObject" (in VBA library)
It seems cumbersome to have to use the 2 API functions (to find a window handle to Excel and then "post" it to the Object table via a windows message), but in the end it works.
I will now need to control operation in Excel (worksheet) from within Access and VBA. Ultimately, I will use a chart in my Excel file as a template, changing the values according to latest data in Access.
Best regards,
Johnny
|
|
|
|
|
Johnny,
Since you seem to know how to use VB & Excel together, is there any chance that you would have time to look at my Jan. 6th Post, "VB/Excel interaction"? I have tried everything that I can think of and I still can't make it work. Nobody else has answered.
Thanks in advance, Garner
|
|
|
|
|
When tabbing in my datagrid after the third column I want to set focus back to the first column.
I thought about setting the tab stops to false after the third column or writing some kind of event handler? Any help would be appreciated.
|
|
|
|
|
I get the following error "Exception from HRESULT: 0x800A03EC." when I get to this stage of my procedure.
.Range("A" & i.ToString).Value = myRdr("LastName")
Any ideas? I have forwarded the code. Also how to I make sure I have closed EXCEL
Thanks in advance
Private Sub ExcelExtract(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Extract.Click
Dim sProcName As String
Dim sInfoMsg As String
Dim sCriteria As String
Dim i As Double = 3
Dim myRdr As OleDb.OleDbDataReader
Dim excelApp As New Excel.Application
Dim excelBook As Excel.Workbook = excelApp.Workbooks.Add
Dim excelWorksheet As Excel.Worksheet = CType(excelBook.Worksheets(1), Excel.Worksheet)
sProcName = "ExcelExtract_Click"
'Makes Excel invisible to the user until spreadsheet is populated
excelApp.Visible = False
Try
'Populate the Floor Report DataSet used for the Excel spreadsheet
sCriteria = ""
sCriteria = "SELECT LastName, FirstName, Age FROM EmployerTable
Dim myCommand As New OleDb.OleDbCommand(sCriteria, sOleDbConnection)
myRdr = myCommand.ExecuteReader
Catch ex As Exception
sProcName = "ExcelExtract_Click - Populate Report Dataset"
Me.Cursor = System.Windows.Forms.Cursors.Default
ErrorMsg(mcNAME, sProcName, sInfoMsg)
End Try
With excelWorksheet
'Format the Excel cells
.Range("A1..C2").Font.Bold = True
.Range("A1..C2").ColumnWidth = 15
.Range("A1").Value = "REPORT as at " & Now
.Range("A2").Value = "Surname"
.Range("B2").Value = "Forename"
.Range("C2").Value = "Age"
Try
'Place the values into the spreadsheet
Do Until myRdr.Read = False
.Range("A" & i.ToString).Value = myRdr("LastName")
.Range("B" & i.ToString).Value = myRdr("FirstName")
.Range("C" & i.ToString).Value = myRdr("Age")
i = i + 1
Loop
Catch ex As Exception
End Try
End With
excelApp.Visible = True
End Sub
|
|
|
|
|
Your myRdr statements are returning the values of LastName, FirstName, and Age in their native database formats. Try it this way:
While myRdr.Read()
.Range( String.Format("A{0}", i) ).Value = myRdr.GetString(0) ' LastName
.Range( String.Format("B{0}", i) ).Value = myRdr.GetString(1) ' FirstName
.Range( String.Format("C{0}", i) ).Value = myRdr.GetInt32(2) ' Age
i+=1
End While
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
It is now working.
Thanks for the your help
|
|
|
|
|
I get the same error when I try the following
.Range(String.Format("A{0}", i)).Value = myRdr.GetDecimal(0)
|
|
|
|
|
Is the first column is your dataset a string or a number?
I'm willing to bet it's a string. Calling GetDecimal on a database string value will throw an exception.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
It is a number.
When I type in GetFieldType it say that it is a decimal. The way I have got round this problem was Convert.ToString. Doing this seems to work. I now have other fields that have 2 decimal points i.e. factor , 2.34 and have applied the Convert.ToString way.
|
|
|
|
|
I do not want the user to be able to sort the DataGrid by clicking on a column heading. I'm using the following piece of code yet it does not prevent sorting.
Me.DataGrid1.AllowSorting = False
What else must I do?
Thanks
-- modified at 11:33 Tuesday 10th January, 2006
Found answer
In the TableStyles you can set AllowSorting = False
|
|
|
|
|
What are you binding the DataGrid to? In some cases, you need to turn Sorting off on the bound source too.
Better yes, show us the code you're using to setup the datagrid and bind the datasource to it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-- modified at 12:37 Tuesday 10th January, 2006
|
|
|
|
|
The datagrid is bound to a dataview. Turning off sorting at the datagrid does not work. Turning it off at the tablestyle does. Below is the requested sample code.
Me.DataGrid1.DataSource = DataTableOrdersDetail.DefaultView
'Me.DataGrid1.AllowSorting = False
Dim grdTableStyle1 As New DataGridTableStyle
grdTableStyle1.AllowSorting = False
With grdTableStyle1
.MappingName = "DataTableOrdersDetail"
.RowHeadersVisible = False
With .GridColumnStyles
.Add(New DataGridTextBoxColumn)
With .Item(0)
.MappingName = "QuantityOrdered"
.HeaderText = "Ordered"
.Width = 55
.NullText = ""
End With
-- modified at 8:35 Thursday 12th January, 2006
A question with the above code: If the datagrid datasource is connected to a dataview shouldn't column 0 mappingname use the dataview also? It does not work if I try it.
|
|
|
|
|
I am reading from an XML file and populating a Dataset object. To make sure that the dataset is being populated, I created dataviews since I have multiple tables created from the XML file in the dataset.
As I have to take care of the relationships between tables, I have to populate a table in the database from the results of the dataset/dataviews generated. What I tried to do is creating an insert stored procedure but am stuck on how to get the parameters values from the dataset/dataview. Any help would be appreciated!
objDataset.ReadXml(strFile)
Dim dvLayers As New DataView(objDataset.Tables("Layer"))
Dim dvDatasets As New DataView(objDataset.Tables("Dataset"))
Dim dvREnderer As New DataView(objDataset.Tables("SIMPLERENDERER"))
Dim dvLineRenderer As New DataView(objDataset.Tables("SIMPLELINESYMBOL"))
Dim dvPolyRenderer As New DataView(objDataset.Tables("SIMPLEPOLYGONSYMBOL"))
Dim dvMarkerRenderer As New DataView(objDataset.Tables("SIMPLEMARKERSYMBOL"))
|
|
|
|
|
These DataView's are useless since you're only putting the data from a single table into each one and you haven't changed what your viewing in each table. You're actually just returning the exact same thing each tables default view would return.
What does your INSERT SQL stuff look like? That's where the bulk of the work is going to be done.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|