The Sandbox Thread

16 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

file shortcuts for Visual Basic

Back to Forum: The Sandbox
  • User profile image
    leighsword
  • User profile image
    gswitz

    Thanks for posting code, but I can't get this to work. I've run it over and over, entering different things into the text boxes... following your examples, and I have not created a single shortcut on my desktop.

    Am I missing something?

    Thanks,

    Geoff

  • User profile image
    Sven Groot

    Wow, you really like doing things the complicated way, don't you? Creating a COM object to do something when there's already a COM object to do just that, using different COM objects in the process.

    I think this deserves an award for "longest detour of the year".

    To top it all off, your code can't deal with Unicode file names.

    gswitz: did you register CreateShortcut.dll? It's a COM object so you don't have nice xcopy deployment like with a .Net assembly, unless you use registry-free COM interop (which leighsword didn't).

  • User profile image
    gswitz

    When I built the project, it seemed to register everything. I did not execute a regsvr32 command.

    Anyway, it doesn't really matter. I don't need it; I was just trying it.

    Thanks,

    Geoff
      

  • User profile image
    leighsword

    Sven Groot wrote:
    Wow, you really like doing things the complicated way, don't you? Creating a COM object to do something when there's already a COM object to do just that, using different COM objects in the process.

    I think this deserves an award for "longest detour of the year".

    To top it all off, your code can't deal with Unicode file names.

    gswitz: did you register CreateShortcut.dll? It's a COM object so you don't have nice xcopy deployment like with a .Net assembly, unless you use registry-free COM interop (which leighsword didn't).

    the code absoultly can handle the UNICODE chars,to build using  'Release_unicode' option.

    sometimes we need to convert simple things to complex things, make others feeling it's amazing, CPU is a good example.
    sometime we need to convert complex things to simple things, it shows we are good at comunicating or teaching.

  • User profile image
    Sven Groot

    This code tells me it can never deal with unicode:

    string strApplicationPath;
    string strPathLink;
    string strDescribe;

    strApplicationPath = CW2A(ApplicationPath);
    strPathLink = CW2A(PathLink);
    strDescribe = CW2A(Describe);

    string is always ansi, regardless of whether UNICODE or _UNICODE is defined. For the unicode string class, you need wstring. So if any of these strings contain characters that are not in the system codepage, this won't work as expected.

    And I stand by my claim: you took something that was simple to do from a .Net language, implemented an incredibly complex way of doing it, which in the end has made using it from .Net not any simpler (you still need to do COM InterOp). It just doesn't make any sense to do any of this.

    And to me, doing something the hard way just to show you can means that you're a developer that will 1) take too long on trivial tasks and 2) produce code that is hard to maintain by others. If I had asked you to create a program that creates shortcuts in VB.NET as part of a job interview, and you came up with this, I most certainly wouldn't have hired you.

  • User profile image
    leighsword

    Sven Groot wrote:
    This code tells me it can never deal with unicode:

    string strApplicationPath;
    string strPathLink;
    string strDescribe;

    strApplicationPath = CW2A(ApplicationPath);
    strPathLink = CW2A(PathLink);
    strDescribe = CW2A(Describe);
     

    string is always ansi, regardless of whether UNICODE or _UNICODE is defined. For the unicode string class, you need wstring. So if any of these strings contain characters that are not in the system codepage, this won't work as expected.

    And I stand by my claim: you took something that was simple to do from a .Net language, implemented an incredibly complex way of doing it, which in the end has made using it from .Net not any simpler (you still need to do COM InterOp). It just doesn't make any sense to do any of this.

    And to me, doing something the hard way just to show you can means that you're a developer that will 1) take too long on trivial tasks and 2) produce code that is hard to maintain by others. If I had asked you to create a program that creates shortcuts in VB.NET as part of a job interview, and you came up with this, I most certainly wouldn't have hired you.

    #ifndef UNICODE
            psl->SetPath(strApplicationPath.c_str());
    #else
            psl->SetPath(ApplicationPath);
    #endif
    normally, we used to Multi-Byte Character Set, not Unicode Character Set.

    the COM object not only for VB.NET , it 's a language-independent binary file(.net framework steal the idea from COM, so sometimes we call .net as COM+), it's a reusable component, whatever VB(or .net), VC(or .net), Deiphi(or .net) which you use, so it does make sense.
    the simple way is not a best way.

    some stupied programmers(include my boss,but he is not a tech guy) definetly cann't read my mind(code i mean), i don't need respond for everybody when writing code.

    most of our tasks is simple, we are write the Applications(the most difficulty part is the Bussiness logic, never be the programming skills), not a Compiler, not a Database Engine and Opreating System.

    Why i need a VB.NET job? Delphi is a VB killer, and C# is a VB.Net killer, VB without Bill Gate(he made it) who spend tons of money on it, early ten years , it's disappear.

  • User profile image
    dotnetjunkie

    Leighsword, I'm sorry to burst your bubble but I have to agree with the other comments in this thread.

    This program is ridiculous! It's most likely the crappiest piece of code ever shown up on Channel9... do yourself a favour and remove this...

    I would REALLY suggest that you go back to school for a few years to:

    1) Learn what good programming practice and software development is all about.

    2) Discover the advantages of a modern framework like .NET

    3) Study the English language!!! (Can I ask you what age you are??? English is not my mother tongue as well, but every 13 or 14-year old kid has a far better knowledge of English than you do!)  Do you even have a clue how bad it is?!  You can't even conjugate a verb!  Your English is so awful that it's to the point where you sometimes can't even make up or imagine what you were trying to say!
    If you are not intelligent enough to even grasp a basic understanding of a foreign language, you should seriously question your ability to ever become a great developer!

    Don't take this as a flame, this is merely good advice! What you did here is just plain wrong, there is absolutely no point in trying to defend what you did.

    PLEASE, take your time to study more about programming (and maybe by reading all those technical books you will improve your English!!!) and come back in a year or 2.

  • User profile image
    Sven Groot

    dotnetjunkie wrote:
    3) Study the English language!!! (Can I ask you what age you are??? English is not my mother tongue as well, but every 13 or 14-year old kid has a far better knowledge of English than you do!)  Do you even have a clue how bad it is?!  You can't even conjugate a verb!  Your English is so awful that it's to the point where you sometimes can't even make up or imagine what you were trying to say!
    If you are not intelligent enough to even grasp a basic understanding of a foreign language, you should seriously question your ability to ever become a great developer!

    I can't really agree with this point. For one thing, English and Chinese are vastly different languages. Someone who has some Anglo-Saxon, Germanic, Latin or most other western root languages derived first language will have far less trouble learning English than someone who speaks Chinese. We have plenty of Chinese students (both masters and PhD) at my Uni (in fact, I sometimes think the CS faculty has more Chinese members than Dutch...) and their ability to speak English varies greatly, and does not necessarily reflect on their ability as a CS student.

  • User profile image
    dotnetjunkie

    That's a valid point, Sven, but I happen to know some Chinese people as well (one of our clients is the Belgium-China association), and I've never seen someone whose English was as bad as this!  Most of them in fact are very fluent in English...  So it's certainly possible for Chinese people to learn it. Smiley

  • User profile image
    leighsword

    dotnetjunkie wrote:
    Leighsword, I'm sorry to burst your bubble but I have to agree with the other comments in this thread.

    This program is ridiculous! It's most likely the crappiest piece of code ever shown up on Channel9... do yourself a favour and remove this...

    I would REALLY suggest that you go back to school for a few years to:

    1) Learn what good programming practice and software development is all about.

    2) Discover the advantages of a modern framework like .NET

    3) Study the English language!!! (Can I ask you what age you are??? English is not my mother tongue as well, but every 13 or 14-year old kid has a far better knowledge of English than you do!)  Do you even have a clue how bad it is?!  You can't even conjugate a verb!  Your English is so awful that it's to the point where you sometimes can't even make up or imagine what you were trying to say!
    If you are not intelligent enough to even grasp a basic understanding of a foreign language, you should seriously question your ability to ever become a great developer!

    Don't take this as a flame, this is merely good advice! What you did here is just plain wrong, there is absolutely no point in trying to defend what you did.

    PLEASE, take your time to study more about programming (and maybe by reading all those technical books you will improve your English!!!) and come back in a year or 2.

    thank you take time to give me a good advice.
    i wanna practice my English writing, that's why i did here.

    in our company, the best developers(not include me) always are good at learning,  they used to English as possible as they can, when writing mail, reading, speaking(someting mix up Chinese and English).

    but i don't think 1)  i REALLY need to study more about programming,  2)  .net is good for REAL developers( it's easy to use and decompile?).i will show you a simple example why i am able to judge the .net  in next post.

    Be a developer just for money, so i will save enough money and quit this game, then to create my own bussiness, and be a BOSS, final, earn a tons of money, and migrate to USA to create a good educational environment for next generation.
    it's still a dream to me.

  • User profile image
    leighsword

    it's my pleasure, i am interesting in your learning method, and want to get a try, but i don't believe the magic.Big Smile

  • User profile image
    Tonatiúh

    Tonatiúh wrote:

    I am very glad of you having accepted the project Leigh Sword. [...]



    I am quoting my own prior post, just because I need and should appreciate any opinion, critique or suggestion about the way I am trying to approach the reading English problem for people with a foreign native language.

    Tank you
    Carlos Bardullas.

  • User profile image
    Tonatiúh

    Leighsword

    I am from México, and my mother’s language is Spanish... When I read that post from dotnetjunkie, really I go angry at first... Then I become very sad. In the view my soul is able to depict from such a "merely good advice", which in turn depends on the linguistic paradigm my brain is used to think; the dotnetjunkie is, taking it the better way I could, very near to the point of turning a Niner’s shy attempt to participate in this community, into a crude and discriminatory bursting-the-bubble-of-some-body-else. You are a woman and likely, a very young woman. So I have to add that such an assertion is by long measures, a merciless way to give good advice... Certainly it is the way a strong man, at least as a programmer and if we take his pretended knowledge and professional relationships by truth; tries to scorn a fragile, although not weak, colleague from his paired genre… Of course, that post is not by any mean or plea, the way a whole professional asserts his posture in front of the birds of his same feathers.

     

    Nothing to do about incidents like that, but to feel sad and keep yourself far away from the temptation of responding that kind of good advice… Keep your mind together young lady and keep onto that great goal of you which pursues to learn to master both: The Visual Basic language and the English language… The efforts you have already done, plus the courage to endure the aforementioned incident is the right way to mastering both of those languages, and any thing else you will try to learn.

     

    Nowadays, I am 60 years old, have 4 children (not so as their ages range from 29 to 40), and 13 grand-children (from almost birth to near 23)… I have started programming in 1973, and have teaching a variety of subjects more than 30 years. When I have seated at the front of my first desktop, and I got the user manual as the solely source to cope with my duty, I have to start self-learning to read in English. Such a situation have spanned over each day of each month of each year, up to about 1995, when computer handbooks and documentation have started to be available in Spanish. Today, I prefer to read English technical texts, than its translations to Spanish, just because with few exceptions, a lot meaning is lost as most translators are profane to technical concepts and linguistic paradigms.

     

    In 1990, me and my wife have developed an intuitive self-learning method for learn to read English texts. We put it into trialing at a modest private computing school we have started as an entrepreneurial project. Measuring its outcome by the influence in the foreign language course performance enhancement, of the youths from high school level who have exercised such a method, it was indeed a grateful achievement.

     

    If you wish, I may open a new thread at the coffeehouse forum, to share with you, and any Niner else interested in, the method I am talking about. Of course I am aware that it is very different to go from English to Chinese, than from English to Spanish; as not only the semantics, but the mean to represent the phonemes, are truly incompatible: ideograms for Chinese and phonograms for Spanish.

     

    What do you think about this experiment Leighsword? After thinking it for a wile, I see it could be more worth to me than to you, as if you accept to engage in this project, I will get a real prove my method works almost for any language.

     

    NOTE FOR DOTNETJUNKIE: I HAVE WRITTEN THIS POST USING MICROSOFT WORD, WITH THE ORTHOGRAPHICAL AND GRAMMATICAL ON WRITING FEATURE ENABLED. AND MAN, IF IT HAPPENS THAT THIS PROJECT BECOMES FULFILLED, I SWEAR YOU I WILL ASK LEIGHTSWORD TO TEACH YOU THE METHOD TO READ CHINESE… THAT SHOULD ENHANCE YOUR PROFFESIONAL CHINESE RELATIONSHIPS… DOES NOT IT?

    2. Be a human being. Channel 9 is a place for us to be ourselves, to share who we are, and for us to learn who our customers are.

    3. Learn by listening. When our customers speak, learn from them. Don't get defensive, don't argue for the sake of argument. Listen and take what benefits you to heart.

    4. Be smart. Think before you speak, there are some conversations which have no benefit other than to reinforce stereotypes or create negative situations.

  • User profile image
    Tonatiúh

    Dear lady Leigh Sword:

    Just several minutes a go, I have downloaded your Project files, and was wondering why, if the title of this shared experiment is "File shortcuts for Visual Basic", the project I have stored on my disk composes of two solutions: one for C++ and other for C#.

    At this time, I am starting on my learning of those both languages (C++ and C#), but I consider my self (please do not read this VB Developers) an expert (soto voce) in Visual Basic matters. Actually I am enjoying every Visual Studio 2005 Express Beta 2 language IDE1: Visual Basic, C++, C#, J#, ASP.NET (the Visual Web Developer) and SQL Server CTP, at not greather cost than go to the appropriate page (the one with all the stuff is linked above) on the MSDN Developers site and download.

    I suggest you to download and install, at least, the Visual Basic 2005 Express Beta 2 (it downlods a bootstraper in about 15 minutes and then remotely executes the installer from the site, in near one and a half an hour (times taken with my conecction speed at 100 MBPS).

    As I am willingly to keep my self helping if you like so, if you install in your computer VB 2005 Express, both of we will enable our selves to bring into true live this project of you, in the way it have been originaly planned by you.

    Aside, I encourage you to edit this thread opening post, and give to the Niners a brief, although sufficent, statement (the more technical and polite, the bether) about how you have conceived: "File shortcuts for Visual Basic"... Things like statement of purpose, application block diagram, User Interfase prototipe and so on.

    I will look forward for you... Keep your mind... And your soul together Leigh Sword... Please.

    多么美丽的彩虹啊

    NOTE: the sentence above is "I will look forward for you... Keep your mind... And your soul together Leigh Sword... Please".

  • User profile image
    Tonatiúh

    I am very glad of you having accepted the project Leigh Sword. Dear lady, there is not any magic into such a method. Well, not more magic than that used by Socrates to teach: "The dialectic of the mayeutic[i] process of teaching<--->learning"... Let us illustrate how it works:

    1.       This has been applied by some Spanish thinking[ii] persons, willing to read-write English as a foreign language (not applicable for hearing<­­––>talking). Furthermore, that person should have been raised in an environment strongly influenced culturally, by the English language, preferably by means of written media (which nowadays it is not the case for China, but could be truly supplemented by a disciplined exercise like the one already have you demonstrated to own with your participation here).

    2.       The first session, which is the only one needing a bit of guidance, have to be attended as the following algorithm depicts (I will consider on the fly the linguistic differences between Chinese and Spanish): NOTICE: YOU MUST NOT USE ANY OTHER MEANS BUT THOSE GIVEN AHEAD, TO HELP YOU IN TRANSLATING. PARTICULARLY YOU HAVE NOT TO USE ANY KIND OF ENGLISH-CHINESE DICTIONARY AND/OR NOT TO ASK ADVICE OF ANYBODY ELSE BUT YOUR SELF.

    a)       Take any whole paragraph of at least 20 rows (the larger, the better), from any English text and write it by drawing and by hand [iii] down in a sheet of paper (it is strongly suggested you get that text from a technical, scientific or academic source, which is moreover reasonably guaranteed to be a formal document, accurate grammatically and orthographically).

    b)       Read the English text with awareness better than with concentration, but letting your serendipity[iv] run at free, and as many times as you need, until your become able to grasp the one and whole idea[v] the paragraph is dealing with.

    c)       Try to break down the big idea you have grasped from that paragraph, and as you get each intelligible piece of idea, write it by drawing, by hand, in Chinese ideograms and from right to left (I do not know if Chinese is written from right to left) in a separate sheet of paper. Be aware of regard as for not been between the English text and its Chinese translation, any one-to-one correspondence between each word (an ordered set of phonemes, each an arbitrary arrangement of lines and shapes) and each ideogram (an arbitrary graphic depiction which is intended to be an image abstracted of the idea it represents).

    d)       Put aside the English text and preferably, hide it from you eyes; and read several times the Chinese translation first approach you have gotten at the prior step. DO NOT TRY TO REMEMBER ANY OF THE ENGLISH WORDS OR SENTENCES FROM WHICH YOUR TRANSLATION COME, BUT KEEP IN MIND THE BIG IDEA YOU HAVE GRASPED AT STEP “b”. YOU HAVE TO READ ALL THE TIMES YOU NEED TO BE SURE THE WAY YOUR CHINESE TRANSLATION EXPRESSES THE ORIGINAL IDEA, IS WELL SPELLED IN CHINESE GRAMMATICAL AND SEMANTIC TERMS. IF YOU FEEL THERE IS ANY NEED TO SUBSTITUTE, ADD AND/OR DELETE ANY IDEOGRAMS TO ENHANCE THE LINGUISTIC QUALITY OF YOUR TRANSLATION, DO NOT HESITATE TO DO IT STRAIGHT AHEAD. WHEN YOU BECOME SATISFIED, ALL IS BEEN DONE. IF YOU ARE SURE THE IDEA YOU HAVE GRASPED AT FIRST FROM THE ENGLISH TEXT, AND YOUR CHINESE TEXT IS A BEAUTY, OR AT LEAST, A PROPERLY WRITTEN  PIECE OF CHINESE LITERATURE; EVEN IF THERE IS NOT, IN A “WORDING” WAY, ANY RESEMBLANCE BETWEEN HOW BOTH TEXTS ARE SPELLED OUT: YOU HAVE SUCCESSFULLY TRANSLATED THE TARGET ENGLISH PARAGRAPH INTO CHINESE.

    Leigh, may be one not so far day, will you teach me how to go from Chinese to Spanish?


    [i]  Mayeutic is a term from Greek. Coined by Socrates as the characterization of his teaching method, supported on a basic assumption about the way any human being is able to learn. That way is "walked along" by assimilating into each human being existent epistemic paradigm, those mental entities for which she or he are consciously able to give any arbitrary set of denotations-connotations, only meaningful to her or his self and solely if it is interpreted at the light of such a paradigm. Mayeuta was the name given to a midwife at the ancient Athena. The Socrates mother was a mayeuta and from there, the philosopher derived the name for his teaching method as for implying a teacher (mayestro—>magister—>master), is solely the facilitator for her or his disciple's knowledge delivery. Hence, a teacher is a mayeuta for a disciple’s child-of-the-mind birth (Please relate semantically disciple with discipline, the later is, accordingly to its philological path, the essence of been the former. Told in less poetic words, is the way a disciple should behave. Given that, discipline has not any of such connotations as: Enforcement, lost of freedom, ruled conduct, etc. that is, as been disciple must mainly be accepting  the guidance of a particular master, by her or his free will, self awareness, and self interest, following the path her or him [the master] shows, with confidence, compliance and gentleness. Then, those three attributes fully define what discipline is about).

    [ii]   The understanding of any given grammatical language (included programming languages) presupposes a particular way-of-building-the-idea denoted by its grammar components (the words in phonetic languages, the ideograms in ideogrammatic languages—see why an image is worth for a thousand words?). In short: Any given language must be understood by means a particular way of thinking.

    [iii] People around uses to get surprised when seeing any hand written text I have authored. Besides there is no valid reason to be amazed with, just because at first school I was trained to scribble, not to write (know the Palmer method? I used it, ink and for short years, I have escaped from using a goose feather too). Yes, I am a selfish person. Anyhow, I have started at my 8 years on drawing and painting to become a drafter, draughtsman and cartoonist about my 20ths. What is worth for the purposes of this paper, put aside the selfishness certainly is involved, is that to develop fine writing skills, one must scribble the letters. Finally, any phonetic character is a shy draw. Perceiving phonetic languages writing in this fashion, would help you, Leah Sword , to think that writing such languages is alike with the way yow DRAW the ideograms Chinese use to represent ideas, aware of the fact, that we draw sound pictures as you draw ideas portraits, and the former should be very simple drawings (no more than six different lines as in the "B": one vertical stright line, three horizontal stright lines and two cuved lines).

    [iv] Serendipity, in de sense is used here, is the stage that precede and fire up any creative process. It is characterized by a very loose mind-running mode, in which there are not focalized or specially pursued ideas. Such a term is applicable just because its main connotation is “been conducted by fate or luck”. Such imply both: Determinism and randomness. Both attributes are needed to fire up the creativity settled deeper inside the mind. At that stage, any free will driven epistemic process outcome should be non-creative-thinking. This statement is fully supported by the Gestalt Theory (the original), the Sinectics theory and the Semiotics theory.

    [v]   In the phonetic languages (I do not know about the ideogrammatic ones), given a well formed [syntacticaly] and well styled text, every paragraph will stand for a complete and wide idea, composed of several sentences, each one carrying a subtle idea on the same wide theme,  tied to each other sub-idea (!) by the twine of the writer’s train of thinking and glued by her or his particular style of writing.

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.