|
Hi,
Help me, how we can create windows local user by program.
srinivasraom
|
|
|
|
|
Hi ,,,
I have made an application which uses CrystalReport 8.5 Viewer(that comes with .net setup). I made a setup so that the client can view the reports. I read in the help file that to include all the files for CrstalDecisions we need to include 3 Msm files i.e. merge modules in the setup. They are MANAGED_ENU.MSM, DATABASE_ACCESS_ENU.MSM, REGWIZ.MSM. I couldnt find MANAGED_ENU.MSM, instead of it I included MANAGED.MSM. I also couldnt find DATABASE_ACCESS_ENU.MSM, instead of it I included DATABASE_ACCESS.MSM. They contain the files needed for CrystalDecisions. But when I included REGWIZ.MSM , it doesnt show me any files in the list(When we see the file list in Mergemodule by including it in the setup). It shows empty list. As per the help file, REGWIZ.MSM contains a file called KEYCODEV2.DLL. But its missing in the MSM FILE. And the error I am getting when I try to open the report at clients place is "INVALID KEY CODE". So where should I find these three files so that I can include it in the project. I searched it on the net but could nt get any of these files.
What are the other options for this error???
Thanks Tasnim
|
|
|
|
|
I got this error once when i registered .net. What i did to correct the problem if this helps at all i uninstalled the crystal reports portion of the .NET installation and reinstalled.This seemed to correct my problem hope this helps.
|
|
|
|
|
Hi
I have prepared an application in VB.Net, i have used Crystal Report 9 to make Reports. Component on VB.Net Form i am using is the one which comes together with the VS.Net, i.e of Crystal Report 8.5. So when i make setup (i include all the necessary files like Crystal Descision files) setup installs the product successfully but when i run the project it gives error of KeycodeV2.dll not found, but it is there in the desired path.
Can anyone help me for the problem, it would be really nice as only this report portion is left.
Thanks for going through
Be Humble in Victory and Strong in Defeat. -Het
|
|
|
|
|
Het2109 wrote:
gives error of KeycodeV2.dll not found, but it is there in the desired path
Did you get a licence key for Crystal Reports? I had this problem, and if I remember correctly, to fix it you get a (free) licence key from Crystal Decisions, and stuff that into the Serial Key (?) property for the Crystal merge module in your setup.
It's something like that anyway, I mentally purge myself of Crystal related things as far as possible
Ian Darling
"One of the few systems...which has had “no deaths” in the reliability requirements." - Michael Platt
|
|
|
|
|
|
i want make an application who open one document word or excel.and i want to know how to do that .
|
|
|
|
|
|
sorry,but the link don't work, can you give me an other link.
thank you
|
|
|
|
|
ProCess.STarT("filename") will open a doCumenT in word exCel or any doCumenT u desire To open.
Be Humble in Victory and Strong in Defeat. -Het
|
|
|
|
|
Hello,
when i play a sound file like mp3 or wav with MediaPlayer or anything like
this, i would like to get the volume level of the sound card in real time.
The data is then sent to the serial port. How do i get this data. I tried to
find some samples in msdn or internet but i couldn t find any useful code.
There is the winmm.dll which supports calls to waveIn and waveOut but all
the samples use them to set or get the master volume. That is not what i
need. I thought i found a sample in msdn, but this doesnt work. Is directX a
way to solve this problem?
Can anybody
help me??
|
|
|
|
|
Do you want the "volume level" or the sampled peaks of the output going to the speakers?
Volume is simple, you've already found the code for it.
Sampling the output is a whole other story. Now you have to consider getting the output of 1 to 8 speakers. This sampling can occur very fast, but can your serial port implementation keep up with the rate of data you want to transmit? How fast are you looking at sending data out the serial port?
You might want to look at this[^] link for a sample on MSDN.
RageInTheMachine9532
|
|
|
|
|
Can anybody tell me..How to insert table in richtextbox control as in MS word..I'll be helpful to u...PLease help me sir..
I'll be very thankful to u.
OK! Good Bye...Have a Nice Life..Bye. Sumit Kapoor
---Sumit Kapoor---
|
|
|
|
|
1. You can insert the RTF code using SelectRTF, you'd have get the basic code from wordpad, then modify it a bit.
2. Also you can (although I've not been able to get it to work myself), create a word object and add a table, see the newsgroups for example.
However, even if you get point 1 working there is a problem.
Tables cells don't word wrap in the richtextbox.
I've been looking for a solution to this was a day or two.
I've just been looking at the OLE Object example on this site, I thought I might be able to insert HTML, but I can't get it to work. Even if I could I'd then have a problem with resizing columns.
I've just about ready to give up.
|
|
|
|
|
I am wandering how you would create a menu completely in code. I want to be able to make a menu completely from scratch in code. I really need the code for vb 6.0 mainly but i would like to know how to do it in both 6.0 and .NET if possible. Thank you for any help you can give me.
|
|
|
|
|
I never tried this kind of thing but hope you can do this using API's.
Yogendra Agarwal
Telemune Software Solutions Pvt. Ltd.
Mobile: +91 9818899010
|
|
|
|
|
Hy All.
I have following problem.
"Run time error 426. One form MDI only admitted"
The code allows to print from one form which shows a print preview and, after that, it's possible to click on print commandbutton:
Private sub cmdPrint_click()
gprint = True
Call frmMain.ActiveForm.printText
Unload me
End Sub
Main form is frmMain (MDIForm1). I don't understand why there are two MDI form loaded, as seems to say message error.
Elsewhere, in another similar step, I got same message (in this step I load an image into the document.
The code is following:
Private InsertImage_click()
Clipboard.clear
clipboard.setdata Picture1.Picture
SendMessage frmMain.ActiveForm.Text1.hwnd WM_Paste, 0, 0
Unload Me
End Sub
I suspect it's wrong "frmMain".
Who can help me?
Thanks in advance.
Ric
|
|
|
|
|
at main form when you click a command button another form loads when i select the existing value in the popup form
i use .show method at that time i want to close the main form and open the main from with the existing value
Please help
|
|
|
|
|
at the main form write this also
main.hide(this will hide the main form)
and when another form is loaded then
also create a command button there and write in the code window the following in click event
|
|
|
|
|
write in the main form command button
main.hide
also when second form is loaded then
create a commandbutton and write the following code
me.hide
main.show
|
|
|
|
|
Hi,
I am trying to create a SPARSE file that reflects the size of an original file. for excample, I would like to create a 33gb(Logical) file that is physically only a few bytes.
I am able to create a 0(logical/physical) byte file only with the following code but I can't seem to get the Logical value assigned. Could someone tel me what I'm missing?
Module Module1
Public Declare Function CreateFile Lib "kernel32" Alias "CreateFileA" ( _
ByVal lpFileName As String, _
ByVal dwDesiredAccess As Integer, _
ByVal dwShareMode As Integer, _
ByVal lpSecurityAttributes As Integer, _
ByVal dwCreationDisposition As Integer, _
ByVal dwFlagsAndAttributes As Integer, _
ByVal hTemplateFile As Integer) As Integer
Public Declare Function SetFilePointer Lib "kernel32" Alias "SetFilePointer" ( _
ByVal hFile As Integer, _
ByVal lDistanceToMove As Integer, _
ByVal lpDistanceToMoveHigh As Integer, _
ByVal dwMoveMethod As Integer) As Integer
Public Declare Function SetEndOfFile Lib "kernel32" ( _
ByVal hFile As Integer) As Integer
Public Declare Function CloseHandle Lib "kernel32" ( _
ByVal hObject As Integer) As Integer
Public Declare Function DeviceIoControl Lib "kernel32" ( _
ByVal hDevice As Long, _
ByVal dwIoControlCode As Long, _
|ByVal lpInBuffer As String, _
ByVal nInBufferSize As Long, _
ByVal lpOutBuffer As String, _
ByVal nOutBufferSize As Long, _
ByVal lpBytesReturned As Long, _
ByVal lpOverlapped As String) As Long
End Module
Public Class Form1
Inherits System.Windows.Forms.Form
Const _WIN32_WINNT = 5
Public Const CREATE_ALWAYS = 2
Public Const CREATE_NEW = 1
Public Const OPEN_ALWAYS = 4 'Create if doesn't exist
Public Const OPEN_EXISTING = 3
Public Const TRUNCATE_EXISTING = 5
Public Const FILE_ATTRIBUTE_ARCHIVE = &H20
Public Const FSCTL_SET_SPARSE = &H900C4
Public Const MOVEFILE_REPLACE_EXISTING = &H1
Public Const FILE_ATTRIBUTE_TEMPORARY = &H100
Public Const FILE_BEGIN = 0
Public Const FILE_SHARE_READ = &H1
Public Const FILE_SHARE_WRITE = &H2
Public Const GENERIC_READ = &H80000000
Public Const GENERIC_WRITE = &H40000000
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim h
Dim d
Dim n
Dim dw As Integer
Dim lDist As Integer
h = CreateFile("D:\Wes.log", GENERIC_WRITE + GENERIC_READ, 0, 0, CREATE_ALWAYS, 0, 0)
dw = 0
d = DeviceIoControl(h, FSCTL_SET_SPARSE, n, 0, n, 0, dw, 0)
lDist = 8
MsgBox(h & " " & lDist)
SetFilePointer(h, 0, lDist, FILE_BEGIN)
CloseHandle(h)
End Sub
|
|
|
|
|
First, your declaration for DeviceIOControl is wrong. Your passing all variable in ByVal, but some of the parameters must be passed in ByRef. This is because DeviceIOControl is looking for the address of the variable, not it's value. The parameters that start with 'lp' are actually long pointers, which represent a 32-bit address, not a value. This is where you pass by reference.
Public Declare Function DeviceIoControl Lib "kernel32" ( _
ByVal hDevice As Long, _
ByVal dwIoControlCode As Long, _
ByRef lpInBuffer As String, _
ByVal nInBufferSize As Long, _
ByRef lpOutBuffer As String, _
ByVal nOutBufferSize As Long, _
ByRef lpBytesReturned As Long, _
ByVal lpOverlapped As String) As Long
Try that and see what happens...
RageInTheMachine9532
|
|
|
|
|
I've tried it but it dies with the following error.....
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at WS_NTFS.Module1.DeviceIoControl(Int64 hDevice, Int64 dwIoControlCode, String& lpInBuffer, Int64 nInBufferSize, String& lpOutBuffer, Int64 nOutBufferSize, Int64& lpBytesReturned, String& lpOverlapped)
at WS_NTFS.Form1.Button1_Click(Object sender, EventArgs e) in D:\@Projects\WeshillNTFS\NTFS_5_PT2_Src\WS_NTFS\Form1.vb:line 127
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
|
|
|
|
|
Part of the problem is you are passing in strings for your buffers, don't. This is the example your looking for:
Imports System
Imports System.IO
Imports System.Text
Imports System.Runtime.InteropServices
Module Module1
Private Const FILE_ANY_ACCESS = 0
Private Const FILE_READ_ACCESS = 1
Private Const FILE_WRITE_ACCESS = 2
Private Const FILE_DEVICE_FILE_SYSTEM = 9
Private Const GENERIC_READ = &H80000000
Private Const GENERIC_WRITE = &H40000000
Private Const FILE_SHARE_READ = 1
Private Const FILE_SHARE_WRITE = 2
Private Const CREATE_NEW = 1
Private Const CREATE_ALWAYS = 2
Private Const OPEN_EXISTING = 3
Private Const OPEN_ALWAYS = 4
Private Const TRUNCATE_EXISTING = 5
Public Const FSCTL_SET_REPARSE_POINT = &H900A4
Public Const FSCTL_GET_REPARSE_POINT = &H900A8
Public Const FSCTL_DELETE_REPARSE_POINT = &H900AC
Public Const FSCTL_SET_SPARSE = &H900C4
Public Const FSCTL_SET_ZERO_DATA = &H980C8
Private Const INVALID_HANDLE_VALUE = -1
Private Declare Function GetLastError Lib "kernel32" Alias "GetLastError" () As Integer
Private Declare Function CreateFile Lib "kernel32" Alias "CreateFileA" ( _
ByVal lpFileName As String, _
ByVal dwDesiredAccess As Integer, _
ByVal dwShareMode As Integer, _
ByVal lpSecurityAttributes As Integer, _
ByVal dwCreationDisposition As Integer, _
ByVal dwFlagsAndAttributes As Integer, _
ByVal hTemplateFile As Integer) As Integer
Private Declare Function CloseHandle Lib "kernel32" Alias "CloseHandle" ( _
ByVal handle As Integer) As Integer
Private Declare Function DeviceIoControl Lib "kernel32" ( _
ByVal hDevice As Integer, _
ByVal dwIoControlCode As Integer, _
ByRef lpInBuffer() As Byte, _
ByVal nInBufferSize As Integer, _
ByRef lpOutBuffer() As Byte, _
ByVal nOutBufferSize As Integer, _
ByRef lpBytesReturned As Integer, _
ByVal lpOverlapped As Long) As Integer
Sub Main()
Dim path As String = "D:\MyTest.dat"
Dim hFileHandle As Integer
Dim rc As Integer
Dim iBytesReturned As Integer
Dim inBuffer(512) As Byte
Dim outBuffer(512) As Byte
hFileHandle = CreateFile(path, GENERIC_READ Or GENERIC_WRITE, FILE_SHARE_READ Or FILE_SHARE_WRITE, 0, CREATE_ALWAYS, 0, 0)
If hFileHandle <> INVALID_HANDLE_VALUE Then
Console.WriteLine("The {0} file has been created, handle is {1}.", path, hFileHandle)
If Not ReportSparseStatus(path) Then
' Change the status to sparse...
rc = DeviceIoControl(hFileHandle, FSCTL_SET_SPARSE, inBuffer, 0, outBuffer, 0, iBytesReturned, 0)
Console.WriteLine("DeviceIOControl returned {0}.", rc)
CloseHandle(hFileHandle)
If rc = 0 Then
rc = GetLastError()
Console.WriteLine("DeviceIOControl failed with Win32Error {0}.", rc)
Else
Console.WriteLine("DeviceIOControl call with FSCTL_SET_SPARSE returned as successful.")
If ReportSparseStatus(path) Then
Dim fs As New FileStream(path, FileMode.Open, FileAccess.ReadWrite)
fs.SetLength(33792000000) ' SetLength takes a 64-bit Integer, so GB lengths are possible.
fs.Seek(fs.Length, SeekOrigin.Begin)
fs.WriteByte(42)
fs.Close()
End If
End If
End If
Else
Console.WriteLine("Unable to create file!")
rc = GetLastError()
Console.WriteLine("CreateFile failed with Win32Error {0}.", rc)
End If
Console.Write("Done...Press <Enter> to quit.")
Console.ReadLine()
End Sub
Private Function ReportSparseStatus(ByVal path As String) As Boolean
Dim fa As FileAttributes
fa = File.GetAttributes(path)
If (fa And FileAttributes.SparseFile) = FileAttributes.SparseFile Then
Console.WriteLine("The {0} file is tagged as a sparse file.", path)
Return True
Else
Console.WriteLine("The {0} file is NOT tagged as a sparse file.", path)
Return False
End If
End Function
End Module
Hope this helps!
BTW: Why would you want to create a 33GB file with nothing in it?
RageInTheMachine9532
|
|
|
|
|
I will give this a try. The reason for this is that I want to copy the original file to tape, for example, then create an empty file of the same name, to free up space. This file will act as a reference to remind me that I do have a file by that name on tape. I know that I could create a 0 byte file but I prefer to see the original size of the file without actually having it use the disk space.
I am hoping that Sparsing would help with this.
Thanks for your help.
|
|
|
|
|