FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Tutorial using Dwin

 
Post new topic   Reply to topic     Forum Index -> DWin
View previous topic :: View next topic  
Author Message
mico75



Joined: 28 Oct 2008
Posts: 5

PostPosted: Tue Oct 28, 2008 3:43 am    Post subject: Tutorial using Dwin Reply with quote

Hi,

I am new in D programming and Dwin. I made this script:

Code:

import tango.io.Stdout;
import dwin.sys.win32.Registry;

void main()
{
    char[] result;
    scope httpkey = RegistryKey.classesRoot.openSubKey(r"HTTP\shell\open\command");
    if(httpkey !is null)
    {
        result = httpkey.getValue!(char[])(null);
        Stdout(result).newline;
    }
    else
        Stdout("failed").newline;
}



I got this error:
C:\Dm\learn>dmd dwin_registry.d
OPTLINK (R) for Win32 Release 8.00.1
Copyright (C) Digital Mars 1989-2004 All rights reserved.
dwin_registry.obj(dwin_registry)
Error 42: Symbol Undefined _D4dwin3sys5win328CodePage11toString16zFAaZPu
dwin_registry.obj(dwin_registry)
Error 42: Symbol Undefined _RegQueryValueExW@24
dwin_registry.obj(dwin_registry)
Error 42: Symbol Undefined _D4dwin4text7convert3Utf8toStringFPuZAa
dwin_registry.obj(dwin_registry)
Error 42: Symbol Undefined _D4dwin3sys5win327Wrapper24expandEnvironmentStringsF
AaZAa
dwin_registry.obj(dwin_registry)
Error 42: Symbol Undefined _D4dwin3sys5win328Registry11RegistryKey11classesRoot
C4dwin3sys5win328Registry11RegistryKey
--- errorlevel 5

So, I did something wrong Sad . Any tutorial/manual using Dwin?

regards,

Mico
Back to top
View user's profile Send private message
yidabu



Joined: 21 Apr 2007
Posts: 87

PostPosted: Tue Oct 28, 2008 6:05 am    Post subject: Reply with quote

I tested the scripts, and it works fine.

You can build a static dwin.lib first, then link the libary:

Code:
pragma(lib, "dwin.lib");

_________________
D yuyan
Back to top
View user's profile Send private message
mico75



Joined: 28 Oct 2008
Posts: 5

PostPosted: Tue Oct 28, 2008 11:33 am    Post subject: Error 42: Symbol Undefined Reply with quote

yidabu wrote:
I tested the scripts, and it works fine.

You can build a static dwin.lib first, then link the libary:

Code:
pragma(lib, "dwin.lib");


Hi,

still did not work. This what I did:
1. Unzip dwin in C:\Dm\dwin
2. Copy dsss.conf from dwin folder to C:\Dm
3. Run: dsss build dwin (built static lib)
4. Copy dwin.lib to C:\Dm\tango\lib (tango is in C:\Dm\tango)
5. Copy dwin subfolder inside dsss_imports to C:\Dm\tango\import
6. Made the script, and put the pragma line
7. Run the script: dmd thescript.d
8. Got the error:
Error 42: Symbol Undefined _RegQueryValueExW@24
C:\Dm\tango\bin\..\lib\dwin.lib(Registry)
Error 42: Symbol Undefined _RegCloseKey@4
.
.
.
(several similar error messages)

Note: I am using Win Vista

Did I make something wrong?

regards,

Mico
Back to top
View user's profile Send private message
yidabu



Joined: 21 Apr 2007
Posts: 87

PostPosted: Tue Oct 28, 2008 4:47 pm    Post subject: Reply with quote

It's may be a DMD configuration issue, check the dmd/bin/sc.ini settings.
_________________
D yuyan
Back to top
View user's profile Send private message
mico75



Joined: 28 Oct 2008
Posts: 5

PostPosted: Tue Oct 28, 2008 8:13 pm    Post subject: Reply with quote

yidabu wrote:
It's may be a DMD configuration issue, check the dmd/bin/sc.ini settings.


My sc.ini:
[Version]
version=7.51 Build 020

[Environment]
; LIB=%@P%\..\lib;\dm\lib
LIB="%@P%\..\import\lib;%@P%\..\lib;%@P%\..\..\dm\lib"

;DFLAGS="-I%HOME%\common" "-I%HOME%\.."
DFLAGS="-I%@P%\..\import" -version=Tango -defaultlib=tango-base-dmd -debuglib=tango-base-dmd

LINKCMD=%@P%\..\..\dm\bin\link.exe

regards,

Mico
Back to top
View user's profile Send private message
mico75



Joined: 28 Oct 2008
Posts: 5

PostPosted: Wed Oct 29, 2008 4:00 am    Post subject: D Installation Reply with quote

yidabu wrote:
I tested the scripts, and it works fine.

You can build a static dwin.lib first, then link the libary:

Code:
pragma(lib, "dwin.lib");


Hi, I just wondering how your arrangement of D tools in your machine. Smile And how you tested Dwin.


regards,

Mico
Back to top
View user's profile Send private message
yidabu



Joined: 21 Apr 2007
Posts: 87

PostPosted: Thu Oct 30, 2008 11:07 pm    Post subject: Reply with quote

or use DWin recent trunk ?

I tested you code with DWin trunk, DMD 1.036, Tango recent trunk on Windows XP.
_________________
D yuyan
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> DWin All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group