|
mainshotime wrote: Can't get rid of the errors in my code. Pseudocode is supposed so simple from what I hear.
How about you show us your pseudo-code? There can't be any syntax-errors in there, nothing that would keep it from compiling, since there's no fixed set of rules to how pseudo should look. It's merely a description of what the computer should do, in a semi-structured way. Comes very close to how a cook describes baking an omelet;
- Get a pan
- Put it on the stove, turn on the gas
- Throw in some gravy
- ADD BACON
- Do three times:
- Crack egg
- Add egg to gravy
- Heat five minutes
- Eat
I just "made up" the description above, and making up things is usually considered "easy" - there can hardly be an error in above description (if you don't count that the gas is still running when you're eating). If it's wrong according to your teacher, then he sure as Hell should take time to explain why it is wrong in his view and how you can rectify that. If he can't, ask management whether they can replace the babysitter in the class with a teacher.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
I need the on-screen Keyboard codes, which can be written in different languages (keyboard language),please help mi<pre lang="text">
|
|
|
|
|
Something tells me that you do not really understand what this site is all about.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
grigorffef wrote: I need the on-screen Keyboard codes, which can be written in different languages (keyboard language),please help mi
start -> on-screen keyboard -> enter();
|
|
|
|
|
Hello again,
it seems that code translation tools have their problems with Lambda expressions – different from my own but still ... Maybe you can help me again:
C#-code
EventHandler<MailPoppedEventArgs> local = this.MailPopped;
if (local != null){local(this, new MailPoppedEventArgs(index, message, size, uidl, receivedTime));} has been translated to VB.NET this way:
Dim local As EventHandler(Of MailPoppedEventArgs) = Me.MailPopped
If local IsNot Nothing Then local(Me, New MailPoppedEventArgs(index, message, size, uidl, receivedTime)) The resulting error message reminds me that 'MailPopped' is an event so that a 'RaiseEvent' construction is needed. But which would be a proper syntax for the above expression?
Thank you in advance
Mick
|
|
|
|
|
It would look something like this
Dim local As EventHandler(Of MailPoppedEventArgs) = Me.MailPopped
RaiseEvent local(Me, New MailPoppedEventArgs(index, message, size, uidl, receivedTime))
Hope this helps
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
Hi Wayne, I'm going to check it out asap. Thanks for your help!
|
|
|
|
|
You'll need to use the hidden VB event field (add "Event" to the event name):
Dim local As EventHandler(Of MailPoppedEventArgs) = Me.MailPoppedEvent
David Anton
Convert between VB, C#, C++, & Java
www.tangiblesoftwaresolutions.com
|
|
|
|
|
Hello everybody,
I've been converting a project to VB (Express 2010) and have to face a bunch of errors it Lambda expressions – probably resulting from the conversion tool. The errors are "expression has no value" (German equivalent / I hope the translation is correct). The code looks like this:
mainDispatcher.Invoke(CType(Function() logs.Add(New LogInfo() With {.Line = e.Line}), Action), Nothing) The underlined part is the error marker. Could you please help me find the correct Lambda expression?
Thank you,
Mick
|
|
|
|
|
I don't see where logs.Add would return a value, so shouldn't that be
mainDispatcher.Invoke(CType(Sub() logs.Add(New LogInfo() With {.Line = e.Line}), Action), Nothing)
|
|
|
|
|
That makes sense, Dave, and I've tried it before - but also with an errorous result. In the changed expression there doesn't seem to be an overload for 'invoke' ...
Still you helped me on the way : Leaving the 'nothing' parameter away finally did the trick.
mainDispatcher.Invoke(CType(Sub() logs.Add(New LogInfo() With {.Line = e.Line, .Response = True}), Action)) Thank you, and kindest regards from Munich / Germany
Mick
|
|
|
|
|
Whoops! Forgot to remove that... sorry!
|
|
|
|
|
i am creating an .exe file in vb.net and running it on 64 bit but it is not running on 64bit the error is about database and one more thing is that am creating database with Ms-access.
How to create setup of MS-Access while creating .exe.
|
|
|
|
|
My guess is that you are using the Microsoft.Jet.OLEDB.4.0 provider to query the database. This does not have a 64 bit alternative, and so the solution is to make sure your application is compiled to run only in 32 bit mode. You can do this by going in to your application properties, then under the build tab, you must select x86 as your platform target, and recompile your app .
Hope this helps
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
I have developed a server application, and i used VB 6.0 but i try making it stand alone program which work but is not acessing my access database, what should i do for my program to access access
database after installing my application?
|
|
|
|
|
What have you done so far as to trying to connect to Access? Why use VB 6? It's been long dead, and why use Access, instead use SQL Server 2008 (full version or express, either depending on requirements)...
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
well, paul is right about VB6.
you don't have to be up-to-date, but that thing is too outdated.
try this or this.
|
|
|
|
|
Continuing to slug through a VB6 to VS2008 conversion. In VB6 I was able to modify Access databases and add tables using a bit of code similar to the following (simplified for explanation)
<pre lang="vb">MyTableDef = MyDb.CreateTableDef(tblName)
' record type
For i = 1 To UBound(Fields)
MyField = MyTableDef.CreateField(Fields(i), FieldType(i), Size(i))
MyTableDef.Fields.Append(MyField)
Next
MyDb.TableDefs.Append(MyTableDef)
MyDb.Close()
Exit Sub
</pre>
Fields, FieldType and Size are arrays with a name, length and type of field to be created and appended.
I would like to duplicate this type of functionality using AD0 in VS2008. I know I can do it with a direct SQL command, but those could get real long and ugly. With this method I just add fields to an array and send them to this function.
Any suggestions?
Thanks in advance
|
|
|
|
|
If you absolutely must use the same functionality, add a reference to DAO. The TableDef and Fields objects are defined there.
|
|
|
|
|
Well the idea sounds good, but is difficult to accomplish.
I'm having trouble with someFolder, filePidl and extract.
I understand that someFolder is a IntPtr, that is passed in as null, and passed out as IntPtr, to use in the next line to reference as a ptr address in the buffer. But I don't understand how making my Interface does anything. I don't see a type in my interface or reference to type.
Then on filePidl, it's a IntPtr going in, but returns as a array of pointers.
extract is suppose to be a IntPtr, and come back pointing to an object.
Anyways, I can't figure out why I can't make the variables work, and the compiler complains about them. I don't know if it's my interface, or the code below.
Value of type IShellFolder cannot be converted to IntPtr.
Dim desktopFolder As IShellFolder = Nothing
Dim someFolder As IShellFolder = Nothing
Dim extract As IExtractImage = Nothing
'Get the parent folder IShellFolder
desktopFolder.ParseDisplayName(IntPtr.Zero, IntPtr.Zero, folderName, 0, pidl, 0)
desktopFolder.BindToObject(pidl, IntPtr.Zero, IID_IShellFolder, someFolder)
'Get the file's IExtractImage
someFolder.ParseDisplayName(IntPtr.Zero, IntPtr.Zero, shortFileName, 0, filePidl, 0)
someFolder.GetUIObjectOf(IntPtr.Zero, 1, filePidl, IID_IExtractImage, 0, extract)
modified 2-Jul-12 17:48pm.
|
|
|
|
|
jkirkerx wrote: and the compiler complains about them.
..what does the compiler say? Is it asking whether you're missing a reference?
If the compiler gives a hint, include it in the post
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
I get this for the someFolder when in the BindToObject
Value of type 'Admin_PM_Standard.IShellFolder' cannot be converted to 'System.IntPtr'.
In one instance, I changed the interface function to
From
<PreserveSig()> _
Function BindToObject(
ByVal pidl As IntPtr,
ByVal pbc As IntPtr,
<MarshalAs(UnmanagedType.LPStruct)> ByRef riid As Guid,
ByRef ppv As IntPtr) As Int32
To
<PreserveSig()> _
Function BindToObject(
ByVal pidl As IntPtr,
ByVal pbc As IntPtr,
<MarshalAs(UnmanagedType.LPStruct)> ByRef riid As Guid,
ByRef ppv As IShellFolder) As Int32
And got the (System attempted to access memory that is protected) during debug. So I think I was on the right track and it worked, only it didn't like the Word 2007 Doc.
[IMPORTANT NOTE]
I should of mentioned this, I'm trying to use this in asp.net. I read that I could extract a thumbnail of an office document using the Shell32.Dll, post XP SP2. I'm starting to think that it is not possible, and that GetThumbnail replaced it, and that getThubmnail only works on image files.
This was an experiement, a chance to call a unmanaged DLL in managed code, to see if I can write something in c++ in the future, to use in my asp.net apps.
|
|
|
|
|
jkirkerx wrote: I should of mentioned this, I'm trying to use this in asp.net.
I really should take a look at that technology one day
jkirkerx wrote: <layer>I read that I could extract a thumbnail of an office document using the Shell32.Dll, post XP SP2. I'm starting to think that it is not possible, and that GetThumbnail replaced it, and that getThubmnail only works on image files.
Let's cheat a bit; I'll bet (another banana) that there are some articles on CodeProject that show how, and you probably have both an XP and a Win7 machine somewhere to test them. Use the example-downloads from the CodeProject-articles to extract the images and dump them in a database.
Then, from your ASP.NET application, consult that database.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
I found some code articles that are very similar. I'll look again.
I just remembered, Sharepoint is a huge web app from Microsoft, that allows folks to share office documents. Sharpoint will create thumbnails of the documents, so the consumer can say, oh that one.
So the Shell32.Dll post SP2 made sense, thinking that Microsoft build in a mechanism for web apps like SharePoint to generate thumbnails of office documents, and now it's native in Server 2003 +
That's what justified the time to explore the thought.
I put this post in the VB discussion, because I thought the subject was way over the heads of the asp.net discussion.
I'm going to look into the out word, and give it another go, and do a little more research
|
|
|
|
|
jkirkerx wrote: That's what justified the time to explore the thought.
Even without justification, it sounded logical and rational. It does help, from the users point of view, if you have a picture to identify the format.
You'll find that different versions of Windows (and even Microsoft Office) generate different sets of icons. Saving it in a database creates an extra abstraction-layer, giving you a bit more control on the endresult.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|