|
Trust me when I say this. I tried to learn how to program for years and was never very good at it until my employer needed a custom app for Office.
I bought a few used books on VBA and found a number of sites like this one. I just started plunking away doing trial and error until I figured it out. You have to really love problem solving and be more stubborn than the code.
As far as I have been able to tell, once you really understand the "mindset" involved in programming, the specific language doesn't matter that much. Once you realize all the things that the more popular programming languages have in common, it doesn't seem quite as difficult.
Still coaxing software out of the can after all these years...
|
|
|
|
|
Hi,
I'm currently using Crystal Reports version 4.6.1.0
which is running on Visual Basic 6.0. I would like to know whether does this version support sending the reports to file and incoporate emailing function.
Thank you. Waiting eagerly for your reply
Best regards,
Jane;)
|
|
|
|
|
You'll have to provide that kind of support in your code. Printing to a file would be setting up a printer driver that specifically prints to a file and then you could email that file yourself using CDO. Crystal Reports 4 doesn't support this directly.
[EDIT]
The supported features documentation on CrystalDecisions website only goes back to version 6, but from what I can figure out, the bundled version that came with Visual Studio 6 does not support Exporting to a file or Email support, not even in version 6...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
Used? You mean the maximum memory that was used?
Use the Performance Monitor (perfmon) and watch the following memory counters:
Process:
Pool Paged Bytes
Pool NonPageed Bytes
Virtual Bytes Peak
Working Set Peak
There is no one value that gives you an accurate measure of how much memory your VB app took up.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
thanks! this problem have been solved.
I'm sorry that I am not use the exact word "used".
I mean the memory that application is useing.
|
|
|
|
|
Slightly different word, same exact problem. There is no one counter that can give you that information.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I've seen tons of samples online of using the VB-Addin control for VB6 for using DirectX, more importantly the directdraw portion.
I was able to muster up some Declarations to DDraw.dll (which was hard to find)...
Declare Function DirectDrawCreate Lib "ddraw.dll" (ByRef pGuid As GUID, ByRef lplpDD As DIRECTDRAW, ByVal pUnkOuter As Long ) As Long
Declare Function DirectDrawCreateEx Lib "ddraw.dll" (ByRef lpGuid As GUID, lplpDD As Any, ByVal iid As Long, ByVal pUnkOuter As Long ) As Long
Declare Function DirectDrawCreateClipper Lib "ddraw.dll" (ByVal dwFlags As Long, ByRef lplpDDClipper As DIRECTDRAWCLIPPER, ByVal pUnkOuter As Long ) As Long
Declare Function DirectDrawEnumerate Lib "ddraw.dll" Alias "DirectDrawEnumerateA" (ByRef lpCallback As DDENUMCALLBACKA, lpContext As Any ) As Long
Declare Function DirectDrawEnumerateA Lib "ddraw.dll" (ByRef lpCallback As DDENUMCALLBACKA, lpContext As Any ) As Long
Declare Function DirectDrawEnumerateEx Lib "ddraw.dll" Alias "DirectDrawEnumerateExA" (ByRef lpCallback As DDENUMCALLBACKEXA, lpContext As Any, ByVal dwFlags As Long ) As Long
Declare Function DirectDrawEnumerateExA Lib "ddraw.dll" (ByRef lpCallback As DDENUMCALLBACKEXA, lpContext As Any, ByVal dwFlags As Long ) As Long
GUID CLSID_DirectDraw = "{d7b70ee0-4340-11cf-b063-0020afc2cd35}"
Can someone give me some insight on how to get at the DirectX with these or are there other procedures that I also need before using these WITHOUT the Addin because I only have VB4 not VB6 besides the application I am making I want to make it so that I could port the code into a language like C++ if I could wiht little effort......
|
|
|
|
|
VB4????? There is a reason there is a control for this for VB6. What you're basically doing is rewriting that control. Are you sure all the work is worth it?
You've got a VERY, VERY long way to go to get all the functions, structures, and constants you need defined to get this to work. Your going to write far more code just declaring this stuff than you are using it. On top of that, you'll be completely on your own. There will not be any examples, using the methods your putting together, calling these functions from VB6, let alone VB4.
Besides, everything your doing in VB4, declaring this stuff, is already done in C++. You don't have to do ANY of the work your doing now...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Essencialy what I'm trying to accomplish is the use of the DirectX to output some MemoryDC's that I have already created to the final output instead of to a form window, or to the desktop window (which has yielded some strange results)
Basically looking for a fast way to BLT the output to a faster surface.
|
|
|
|
|
That's great and and all, but is it really worth the huge amount of work to just get DirectX initialized? After you have the image in memory, what are you going to do with it? I get the feeling your just going to run into the same bottleneck your trying to avoid.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I was looking around to see how to make a media file play in Vb in a form automatically. One of the options in the properties is "ui" and I was wondering what exactly a Ui actually is. And if anyone could tell me how to make a Media file like "sample.wav" play in VB on a click of a button (command button). Thanks alot, my game is due on monday, so im trying to get it all together.
|
|
|
|
|
Sound is a major component of a game. You should've had this integrated into your project a long time ago. Just slapping it in at the end... man...
Boggahutt87 wrote:
One of the options in the properties is "ui"
One of the properties of what? You didn't say what the class was that your looking at.
It is possible to play a wave file, but you'll have to use the Multimedia SDK, or DirectX DirectSound. I seriously doubt you want to use the MediaPlayer COM control to do this. Also, your getting into more complicated audio methods that REQUIRE a sound card to work. Just using the normal PC speaker, like you've been using with Beep, won't work.
Same as before. Declare the API function you want to call first:
Private Declare Function PlaySound Lib "Winmm" Alias "PlaySound" _
(ByVal pszSound As String, ByVal hModule As Long, fdwSound As Long) As Long
Now, when you call this function, you have to supply it with 3 parameters:
1. pszSound will be the filename of the sound you want to play, like "SOUND.WAV". The .WAV file must be in the same directory as your compiled .EXE to work.
2. hModule must be 0.
3. fdwSound must be 0.
You'll call PlaySound like this:
PlaySound "SOUND.WAV", 0, 0
And remember! If you get smacked down by the teacher for using code he didn't tell you about, and therefore you couldn't possibly write , it's not my fault!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Does anyone know how to get default printer using VB.NET?
I want to print the crystal report directly to the printer, but the problem is i need to specify the default printer inorder to print the report.
|
|
|
|
|
I haven't tried this out but...
You might want to try playing with the PrinterSettings class. You can instantiate a PrinterSettings object and see what its PrinterName property says. It might be the name of the default printer. If it's blank, trying getting the InstalledPrinters property. This will be a collection of String s that represent the printer names. You could then set the PrinterName property of the PrinterSettings object to each one of the printer names returned by InstalledPrinters and check the IsDefault property to see if it is the default printer.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hey! thanks for the reply. How do you get each printer name? Does printersettings give the printer? if so, what is that property name? I could not see any printer name property in the installed printers.
|
|
|
|
|
InstalledPrinters returns an array of Strings. Those are your printer names. You then take each one of those and, one at a time, set the PrinterName property to them, then check the IsDefaultPrinter property to see if the name you set PrinterName to is the default printer. If it is, then you have then printer name you need to send to CrystalReports.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
You might want to try playing with the PrinterSettings class. You can instantiate a PrinterSettings object and see what its PrinterName property says. It might be the name of the default printer. If it's blank, trying getting the InstalledPrinters property. This will be a collection of Strings that represent the printer names. You could then set the PrinterName property of the PrinterSettings object to each one of the printer names returned by InstalledPrinters and check the IsDefault property to see if it is the default printer. Warning: The following code has not been tested and is not guaranteed to even compile! That's what I get for using Notepad...
Dim myPrinterSettings As New PrinterSettings
If myPrinterSettings.PrinterName = "" Then
' The PrinterSettings object doesn't come prepackaged with
' the DefaultPrinter name.
' Start checking the list of InstalledPrinters.
Else
' The PrinterSettings object DID come with the DefaultPrinter!
End If
' InstalledPrinters check
Dim Index As Integer
Dim myPrinterSettings As New PrinterSettings
Dim listInstalledPrinters As String()
Dim DefaultPrinterName As String = ""
listInstalledPrinters = PrinterSettings.InstalledPrinters
For Index = 0 To UBound(listInstalledPrinters, 0)
myPrinterSettings.PrinterName = listInstalledPrinters(Index)
If myPrinterSettings.IsDefaultPrinter Then
' We found the DefaultPrinter!
DefaultPrinterName = listInstalledPrinters(Index)
Exit For
End If
Next
' DefaultPrinterName should now contain the name of the DefaultPrinter.
' If it's empty, then this logic didn't work...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I am getting the default printers, but do you know how to get the network printer aswell?
Thanks
|
|
|
|
|
The InstalledPrinters list should contain ALL the printers installed, even the network printers...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
No! its not giving those names. It displays only the installed printers on the local system.
I have personally checked.
|
|
|
|
|
Are you saying that you want the printers that another machine is sharing out, like a File/Print server?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am talking about the shared network printer.
BTW, i got the work around solution for this. Instead of showing it in the crystal report viewer, I am exporting to the pdf format.
This solves the problem, as i need not to bother about the printer settings.
Anyways, thanks for your help.
|
|
|
|
|
Good morning.
Maybe i asking for too much. Let's have it like to know every key the user types. Then how can i proceed.
Thank you for your link, but the process is difficult, and they don't have exemple for vb code use.
I don't know what you can do for me
|
|
|
|
|
Please don't post the same question twice. I already responded to you in your other thread.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|