|
Could you please help me convert this to Vb.Net? Thank you very much in advance.
Getting an image area for displaying in B/W.
CRecImage Image;
CRecInfo Info;
COleVariant vBitmap;
LPBYTE pBitmap = NULL;
HBITMAP hBitmap;
try
{
. . .
Document.SetLineOrder(TOP_DOWN);
Document.SetPadding(PAD_WORDBOUNDARY);
Document.SetRGBOrder(COLOR_RGB);
vBitmap = Image.Get(Info,0,0,160,100);
SafeArrayAccessData(vBitmap.parray,(void **)&pBitmap);
hBitmap = CreateBitmap(Info.GetWidth(),Info.GetHeight(), 1, Info.GetBitsPerPixel(), pBitmap);
. . .
SafeArrayUnaccessData(vBitmap.parray);
VariantClear(&vBitmap);
. . .
catch(CRecException e)
{
TRACE("Error code = %X\n", e.m_hr);
}
|
|
|
|
|
The first question is what is this code supposed to do? I take it it's C++ code and not C#?
There are three classes that are used here, CRecImage, CRecInfo, and CRecException, that not defined in the standard Windows C++ libraries, so you'll have to rewrite those classes in VB.NET. Also, what is 'Document' supposed to represent?
What are you trying to do with this code? What I'm getting at is that it may be possible to write something up in VB.NET native code that doesn't rely on P/Invoking the Win32 API to get the same functionality.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave Kreskowiak wrote:
Also, what is 'Document' supposed to represent?
Looks like it came from an MFC application. But, it still doesn't help work out what it is supposed to do.
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
The Second EuroCPian Event will be in Brussels on the 4th of September
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
My Blog
|
|
|
|
|
That's the problem. I would hate to have this person go through all the trouble of translating this thing, end up with a huge mess of code, then find out that the same thing could have been done with 3-5 line of VB.NET code.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
This is what I am trying to do:
I have a scanned images that I would like to convert to Bitmap images and also would to resize or create a thumnails.
This sample is written in C and was given by ScanSoft tutorial. I can't quite get it right in Vb.Net?
Thanks for your help.
|
|
|
|
|
What's stopping you from loading the scanned image into a Bitmap control and parsing out what you need from there?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Image.Get(Info,0,0,160,100)
the above statement returns an object of unknown. But, really need this to be a Bitmap. Do you know how to convert this to Bitmap?
Thanks
|
|
|
|
|
I want to run two forms at the same time. Also how can i send a text from the first to the second using a buttom.
Thanks.
Go forward and never Stop....
|
|
|
|
|
Make a property on the second form Public so that the first form can get to it. Or you could make a Textbox on the second form Public.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hello
i want to know where can i find the file/folder required to get the winsock control
i cant seem to find it in my vb.net
thank you for your help
Gary
|
|
|
|
|
VB.NET provides the functions of winsock in system.net.sockets. Use the tcpclient and tcplistener classes in your code.
|
|
|
|
|
Hi
I want add one menu item which includes one icon before text, on the menu system of windows when I click right mouse on file.
Example: whenever I click right mouse on file, the menu system of windows will display my menu item named "Send file".
It is the same as Winzip app.
Who can help me??? Thanks a lot
tramdtt
|
|
|
|
|
That's either going to be a context menu Shell extension, or, "Send To..." already exists. All you need to do is add the shortcut to the users "Send To" folder in "C:\Documents and Settings\[userID]\SendTo". For example, you could put a shortcut to Notepad in there, right click on an file and select "Send To.../Notepad" and this would get executed:
C:\Windows\NOTEPAD.EXE [fullPathToFile]
Then all your app has to do is get its CommandLine parameters.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi, thanks a lot Dave
But I want when I click right mouse on file, it will display one menu item named "Send File" on the menu system of Window. Because my app need that.
I have solved it!!!
Now, my problem is the icon in front of the text of menu item???
It is the same as the symbol of Winzip???
Do you understand me???
Thanks
Good luck
tramdtt
|
|
|
|
|
when you open a document in word and save a file, there is a file something like ~....tmp what is this? I know when you open the file there is temp file call ~$Myfile.doc but I don't know about ~...tmp.
|
|
|
|
|
What does this have to do with VB/VB.NET ??
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi every one
i wanna make a something like the clock in the wndows
more illustration i wanna make a text box beside it 2 buttons one in
up direction increase the value in text box and the other decrease it in the down direction and i want to make a circule that will have the numbers and arrow point to this number with the value in the text box
till now it is easy and i think i could do it but the problem that i wanna this circule to move around it's center with another controller like the one before text and 2 commands
how to make a circule round about it's center using vb6?
Lost & Forgotten
|
|
|
|
|
You would use the Cirlce method:
object.Circle [Step] (x, y), radius[, color]
Form1.Circle (1200, 1700), 750
PictureBox1.Circle (1200, 1700), 750
Circle ((ScaleWidth + ScaleLeft) / 2, (ScaleHeight + ScaleTop) / 2), ScaleWidth / 4
You'll probably have to set the Form (or PictureBox) AutoRedraw property to True to get this to work properly.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have made an implementation of an FTP which ought to work fine. But when do a run of it (by the call: http://localhost/FtpBrowser.asp) it says that there's too many users on the site (but I know that I am the only one) or it claims that there's a code error.
What do I do wrong?
I am using XP Pro if that information can help.
This is the code:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
Sub skrivDrev()
set drv = fs.Drives
Response.Write "" & f.path & " "
for each d in drv
Response.Write d.Sharename
Response.Write "" & d.DriveLetter & " "
next
Response.Write "ROOT "
Response.write "[..]"
End Sub
Sub skrivSubFolder()
i = 0
Response.Write ""
i = i + 1
wend
s = s & ""
For Each f1 in fc
if i mod 10 = 0 then
s = s & " | "
end If
i = i + 1
s = s & "" & f1.name & ""
s = s & " "
Next
i = i - 1
while not i mod 10 = 0
s = s & " | | "
Response.write s
End Sub
Sub skrivfiler()
ReDim fileNames(f.files.count)
ReDim fileSize(f.files.count)
ReDim fileType(f.files.count)
ReDim fileDateLastModified(f.files.count)
i = 0
For Each fldr in f.files
fileNames(i) = fldr.name
fileSize(i) = fldr.size
fileType(i) = fldr.Type
fileDateLastModified(i) = fldr.DateLastModified
i = i + 1
Next
response.write ""
For i = f.files.count - 1 to 0 step -1
response.write ""
response.write ""
response.write ""
response.write ""
Next
response.write "Name: | Size | LastModified | Type | "
response.write fileNames(i) & " | " & fileSize(i) & " | " & fileDateLastModified(i) & " | " & fileType(i) & " | "
end sub
%>
<title>Ftp
abc
Testing!-
<%
'if Request.QueryString("sti") > "" then
' sti = Request.QueryString("sti")
'else
' sti = Server.MapPath(".")
'End IF
'Dim fs, f, fc ,sti
'set fs = CreateObject("Scripting.FileSystemObject")
'set f = fs.GetFolder(sti)
'Set fc = f.SubFolders
'skrivDrev
'skrivSubFolder
'Response.Write ""
'Response.Write ""
'skrivfiler
'Response.Write " | "
%>
|
|
|
|
|
You never mentioned what the code error was or what line it was on. And on top of that, this question belongs in the ASP forum.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi
I'm writing an application to display large tiff images.
All of the images have the PixelFormat.Format1bppIndexed
so the FILE SIZE of them will not be so big however
The DIMENTIONS are very large. for example the file size
of an image with dimensions 29350 x 7172, is only 6.7 MB.
The Image.FromFile method loads the above image in the memory
quickly. Now I have the image loaded in memory, how can I
display it fast?
Binding the image object to a PictureBox causes the
"Out of memory" error. I tried drawing portions of
image using "Clone" method in a rectangular region of
the form and scroll bars, inside the OnPaint event.
but it is too slow
Can any one direct me to make it works fast?
Thanx
|
|
|
|
|
Hey,
I have a form I created in access, and I need some help trying to figure out a way to view it in VB .NET or else view the content of the form. On this form it has a section for order history. In this section there are four columns: OrderDate, OrderNumber, CustomerNumber, and A button, which allows you to view the Order information. Is there a way to do this? If so, please let me know.
Thanks,
|
|
|
|
|
Just give you an idea about an application that convert from Access project to VB6 application. I think there is should be an update version that could convert from Access application to VB.Net too. Try to use google and search for it. The application that I used is convert the form from access to vb6, you can use the other control like you use it in access too.
Roath Kanel
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
Evert time I close my app down it comes up with a messagebox saying:
.NET-BroadcastEventWindow.1.0.5000.0.3: App.exe Application Error
The inistruction at "xxxx" referenced memory at "xxxx". The memory could not be "written".
Why is this happening? It doesn't happen if I run it in the IDE. All I did was add a chart compenent to the main form - it only occurs if I click on the chart - I don't actually have to do anything with the chart, I don't even populate it (it also happens if I do populate it)
Rugby League: The Greatest Game Of All.
|
|
|
|
|
Just looked this up on Microsoft.com - they don't appear to have heard of it although they must have written it. There are quite a few posts about it if you do a google search, nobody knows what it is and nobody has a solution. Oh well, my users will just have to do without charting.
Rugby League: The Greatest Game Of All.
|
|
|
|