|
Sorry Dave I think you missed a few things )
1) I'm already using Windows 200 SP4, this has not changed but the DLL has
2) As per the code in my previous postings I am broadcasting the WM_SETTINGCHANGE message and it is working
3) After my app has set the variables I have checked they are set correctly from within visual studio as you have suggested AND from a command prompt (all looks OK)
...but the function called in the unmanaged DLL can't see the variables.
Is it true that the DLL only inherits the environment that is set for the application when it first loads and therefore any env var changes are not seen? Have you heard this before?
anyone else want to chip in?
|
|
|
|
|
madfiddlerchris wrote:
1) I'm already using Windows 200 SP4, this has not changed but the DLL has
2) As per the code in my previous postings I am broadcasting the WM_SETTINGCHANGE message and it is working
All part of the troubleshooting process...I had to ask.
madfiddlerchris wrote:
3) After my app has set the variables I have checked they are set correctly from within visual studio as you have suggested AND from a command prompt (all looks OK)
Now what about inside your own app? Does your own app respond to the WM_SETTINGCHANGE message?
madfiddlerchris wrote:
Is it true that the DLL only inherits the environment that is set for the application when it first loads and therefore any env var changes are not seen? Have you heard this before?
Yes, it's true. This is because the .DLL is loaded into the same process space as your application, and therefore into the same execution environment, security context, environment variables, ... everything. It is not a seperate app, but an extension of your application just like any other part of your app.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi,
I m new to vB.Neti have designed an aplication that scrolls an image, as a background of panel control, accross tha desktop but while scrolling it flickers how can u remove that flickeri.e. it dose not scrolls smooth . I have heard something like double buffer but i havent find some thing useful or an example in VB.Net
Please give me some code example how to enabel double buffering for PAnel Control
|
|
|
|
|
You need to create an inherited panel class so you can set the graphics ControlStyle bits like you can with a form. Here is a snippet:
Public Class GraphicsPanel
Inherits System.Windows.Forms.Panel
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
Me.SetStyle(ControlStyles.AllPaintingInWmPaint _
Or ControlStyles.DoubleBuffer _
Or ControlStyles.UserPaint, True)
Me.UpdateStyles()
End Sub
You need to set all three bits for double buffering to work.
Gary S
|
|
|
|
|
I'm getting an "Unspecified Error" message when I try to run the following code using .NET's System.DirectoryServices to enumerate a list of local groups on a machine. The error pops up right at the point of enumeration of the groups. This only happens when I run this program on an NT machine. It works fine on Windows 2000 and XP. If anyone knows a workaround for this on NT, please let me know. Thanks. Anyway, the code that produces this error is as follows:
Public Sub FindAllGroups()
Try
Dim obComputer As DirectoryEntry
Dim obGroups As DirectoryEntries
Dim strComputer As String = Environ("ComputerName")
Dim itmGroup As ListViewItem
Dim obGroup As DirectoryEntry
obComputer = New DirectoryEntry("WinNT://" + strComputer + ",computer")
obComputer.Children.SchemaFilter.Add("group")
obGroups = obComputer.Children()
'This is where the error starts at
For Each obGroup In obGroups
MsgBox(obGroup.Name) 'display group name
Next
Catch ex As Exception
'Error jumps right to this point
MsgBox(ex.Message) ' spits out unspecified error
End Try
End Sub
|
|
|
|
|
Nevermind,
I figured it out. I needed to install DSClient on the computer in order to use all the ADSI stuff.
|
|
|
|
|
I have asked to change a custom made desktop shell that allows the user to click on various icons to start applications. The custom made shell uses a normal form, which then contains the icons required.
What I have been asked to do is cause a window to open when the user clicks on a Logout icon, that asks them why they wish to logout. So I have created a another form. This contains the usual OK and Cancel buttons and some option buttons inside a frame.
When the user clicks on the logout icon I have carried out a call to the 'Reason for Leaving' form by doing a frmReason.Form_Load. So far everything works ok, and when the user clicks on OK as long as the user has selected a reason for logging out, the user is logged out of NT. However I have a problem when the user clicks on the Cancel button. I want the Form frmReason to close down and redisplay the main form. This though seems to cause a problem.
Is my only way around this to use an MDIForm and then specify the other form as an MDIChildForm.
If the second form I had to open was a MsgBox instead that would be great as this seems to close down without any problems.
Simes
|
|
|
|
|
Hi Simon,
rather than showing frmReason by calling frmReason.From_Load (which you should never do) use something like this...
dim result as DialogResult = frmReason.ShowDialog()
This will allow a DialogResult to be returned to the call. You can then evaluate result to determine what to do next.
i.e.
if result = DialogResult.Ok then
'LogOut of NT
elseif result = DialogResult.Cancel then
'Don't logout of NT
end if
of course you'll still want to evaluate whether or not the person selected a reason in the closing event of the frmReason in order to determine whether or not to close the reason form.
hope this helps.
-jim
|
|
|
|
|
Jim,
Thanks for the reply, but isn't what you have specified to do with Java
Simon
|
|
|
|
|
No, it's not. He just posted a little pseudo-code to give you the idea.
He's right about calling Form_Load. That is something you should never call yourself. The .ShowDialog method is the best way to go, based on the requirements you gave.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Ok, thanks for the tip, but I think I should explin that I am coding in VB 6.0 and not VB .NET. On MSDN there is no mention of VB 6.0 using ShowDialog only VB .NET, hence my confusion. Sorry to say but work still uses VB 6.0 and has not yet progressed to VB .NET
Any other ideas.
All the stuff I have read seems to suggest that I can just do a frmReason.Hide or an Unload frmReason, but when I do this it still leaves the form displayed on the screen and the focus seems to be on an icon on the underlying Form (I can't even seem to select it, everything just locks up and I have to log out of NT).
Thanks Simes
|
|
|
|
|
In that case, it's you'll have to change the way you get the information from the dialog.
You'll build your dialog using a normal form. On it, you have to handle the OK and Cancel buttons. You'll also have to supply a Public Property that holds the DialogResult you set using the OK and Cancel button handlers. To make things a little easier, set the default value for the Property to some value that represents Canceled in the Form's Activate event. When the user clicks OK, set the DialogResult to a different value that represent OK and set the Form's public properties to values that you need from the Form.
Now, to use the dialog, just make a new instance of the form and Show it modal:
myDialog.Show vbModal, Me ' this call will block until the new form is OK'd or Cancel'd.
If myDialog.DialogResult = DialogResult.OK Then
' Pull the values you need from the form
End If
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
yup. what he said...
sorry, was out for lunch. (urp)
-jim
|
|
|
|
|
|
Could someone tell me what I am doing wrong? I am trying to add access into visual basic. I have changed the server for access (Microsoft Jet 4.0 OLE DB Provider). I have done the test connection - all is well. I have added the dataGrid to the web form- Named it MyDG1. I clicked on OldDbDataAdapter and added the connection where the access page is. I have done the Query builder, generate dataset (which I called MyDS). I selected the the dataset and Previewed it - all is well when I filled it in. I assigned a table to the DataView - Shopping Products (my access page). I assigned the DataSource property on the DataGrid as DataView1. In the page_load handler I added
OleDbDataAdaper1.Fill(MyDS1)
Page.DataBind()
I build it - all is good; however when I view in browser that is when I get my error. Here is my error.
Server Error in '/WebApplication1/WebApplication1/Unit5' Application.
--------------------------------------------------------------------------------
Unspecified error
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.OleDb.OleDbException: Unspecified error
Source Error:
Line 83: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Line 84: 'Put user code to initialize the page here
Line 85: OleDbDataAdapter1.Fill(MyDS1)
Line 86: Page.DataBind()
Line 87: End Sub
Source File: c:\inetpub\wwwroot\WebApplication1\WebApplication1\Unit5\WebForm1.aspx.vb Line: 85
Stack Trace:
[OleDbException (0x80004005): Unspecified error]
System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) +20
System.Data.OleDb.OleDbConnection.InitializeProvider() +57
System.Data.OleDb.OleDbConnection.Open() +203
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState) +44
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +304
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +77
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +38
Unit5.WebForm1.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\WebApplication1\WebApplication1\Unit5\WebForm1.aspx.vb:85
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
Can anybody help me?
Thank you,
ibok23
|
|
|
|
|
You question would be better handled in the ASP.NET Forum.
But, off the top of my head, does your server's ASP.NET account have the rights to the folder and database file that your access database resides in?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
yes, i coded it so it would allow the database. I will approach asp.net now. Thanks,
Thank you,
ibok23
|
|
|
|
|
Helo, I am building an VB.NET application that should be able to send a short message service to mobile phone. How should i build it? What resources should I need to build such application?
Thanks
Learning .NET
|
|
|
|
|
Sending SMS messages takes some in depth knowledge of SMS.
You can start by checking out http://www.schmidks.de/vbsms.aspx[^], http://www.textforce.com/sms_api/vb_example.htm[^]. Also, there are a bunch of articles here on CP. Just type "SMS" into the Search box just below the Code Project logo at the top of any page.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Share your story,
How did you learn VB?
|
|
|
|
|
I take a beginner course. While I was taking, I have used the internet resources such as forums as our media to learn VB.Net. I have also leant by myself from the text book.
That's all I learn it.
Thanks.
Learning .NET
|
|
|
|
|
Can you please be more specific (course company, website-Text book name & publisher). I really want to learn but don't know where to start.
|
|
|
|
|
I didn't
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
|
|
|
|
|
How can I get a value from the row that I check using the datagrid below.
Something like e.item.cells(1).text, but I can't get that to apply to the row that I click the checkbox in.
<asp:datagrid id="dgBIA" runat="server" Width="259px" Height="145px" Font-Size="10pt" Visible="False" BackColor="White" BorderWidth="1px" BorderStyle="None" CellPadding="4" BorderColor="#3366CC">
<SelectedItemStyle Font-Bold="True" ForeColor="#CCFF99" BackColor="#009999"></SelectedItemStyle>
<ItemStyle ForeColor="#003399" BackColor="White"></ItemStyle>
<HeaderStyle Font-Size="Smaller" Font-Bold="True" ForeColor="Navy" BackColor="InactiveCaptionText"></HeaderStyle>
<FooterStyle ForeColor="#003399" BackColor="#99CCCC"></FooterStyle>
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<asp:CheckBox id="chk" runat="server" Checked='<%# Databinder.eval(container.dataitem, "There") %>' Visible=true AutoPostBack=True OnCheckedChanged="RA_CheckedChanged">
</asp:CheckBox>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
<PagerStyle BorderWidth="1px" BorderColor="White" HorizontalAlign="Left" ForeColor="#003399" BackColor="#99CCCC" Mode="NumericPages"></PagerStyle>
</asp:datagrid>
|
|
|
|
|
Does anyone know how to create a data dictionary for an advantage database server? Or any help to get me started?
Thanks in advance
Beginner is ASP and VB.Net
|
|
|
|