473,406 Members | 2,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

HLSL in Resource Files

Hi,
I'am developing some application and since I want to create first public release, I am trying to include all resource files (bmps, dlls and so on) into EXE.

The problem is that I have one *.hlsl shader file whitch compiles always on app build. I've tried to put this *.hlsl file into "Resource Files" folder in project, then F5 (build, release, start app), and then I copied just an *.exe file to other directory, where *.hlsl file isn't. Crash...

Application cannot start without *.hlsl file just in same folder as *.exe file is. Whats the problem? Included dll files, icos, bmps works well.

It crashes on these lines where I am trying to load *.hlsl file...

Expand|Select|Wrap|Line Numbers
  1. test = D3DX11CompileFromFile( L"nameof.hlsl",NULL, NULL, "nameofproc", "cs_5_0", dwShaderFlags, NULL, NULL, &pPSBuf, NULL, NULL );
  2. test = g_pd3dDevice->CreateComputeShader( ( DWORD* )pPSBuf->GetBufferPointer(), pPSBuf->GetBufferSize(), NULL, &something );
  3. pPSBuf->Release();
Thanks a lot!

Regards,
Robert Varga
Apr 10 '10 #1

✓ answered by weaknessforcats

Expand|Select|Wrap|Line Numbers
  1. test = D3DX11CompileFromFile( L"nameof.hlsl",NULL, NULL, "nameofproc", "cs_5_0", dwShaderFlags, NULL, NULL, &pPSBuf, NULL, NULL ); 
This looks like Windows code. Literals like "nameofproc" are PCHAR. But literals like L"nameof.hlsl" are PWCHAR.

If your project is Unicode then "nameofproc" becomes PWCHAR which may cause a problem on the Unicode side.

I suggest you a) use TCHAR or b) code Unicode explicitly.

This is the TCHAR version:

Expand|Select|Wrap|Line Numbers
  1. test = D3DX11CompileFromFile( TEXT("nameof.hlsl"),NULL, NULL, TEXT("nameofproc"), TEXT("cs_5_0"), dwShaderFlags, NULL, NULL, &pPSBuf, NULL, NULL ); 

1 4206
weaknessforcats
9,208 Expert Mod 8TB
Expand|Select|Wrap|Line Numbers
  1. test = D3DX11CompileFromFile( L"nameof.hlsl",NULL, NULL, "nameofproc", "cs_5_0", dwShaderFlags, NULL, NULL, &pPSBuf, NULL, NULL ); 
This looks like Windows code. Literals like "nameofproc" are PCHAR. But literals like L"nameof.hlsl" are PWCHAR.

If your project is Unicode then "nameofproc" becomes PWCHAR which may cause a problem on the Unicode side.

I suggest you a) use TCHAR or b) code Unicode explicitly.

This is the TCHAR version:

Expand|Select|Wrap|Line Numbers
  1. test = D3DX11CompileFromFile( TEXT("nameof.hlsl"),NULL, NULL, TEXT("nameofproc"), TEXT("cs_5_0"), dwShaderFlags, NULL, NULL, &pPSBuf, NULL, NULL ); 
Apr 10 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Danny Pressley | last post by:
I have a VS.NET 2003 Visual C++ MFC Application Project in which I added a new resource file, I then added an icon to this new resource file and did a rebuild and got the following error: "fatal...
1
by: Namratha Shah \(Nasha\) | last post by:
Hi All, This is a resource file generation tool which converts an xml based resource formats to .net resource file i.e. (.resources) and vice-versa. Today we will see how we will generate ...
0
by: Kleanthis | last post by:
I have a problem, when deploying multilingual applications using cab files on Compact Framework 2.0. It seems that something is going wrong with compact framework 2.0 Below I have a description...
1
by: urban.john | last post by:
Here are my steps: create resource files from resx files: <echo message="CREATING RESOURCE FILES FROM RESGEN EN" /> <resgen todir="product\resources_en" verbose="true"> <resources> <include...
1
by: Tom | last post by:
This may seem a little strange, but in all my years of developing Windows Forms apps, I've never really used Resource files; however, I would like to start doing so in order to store icons,...
7
by: craig | last post by:
....quick question for anyone who might have some experience with .net resource files in VS 2003. I have an application that is not localized, but I would still like to be able to place all of...
2
by: Andrus | last post by:
I have resource files in different languages created by VCS 2005 Express. I want to use those files to translate reports at runtime. I have text to be translated as string. I think I need to...
12
by: TS | last post by:
i have a need to possibly enable mutli language support. What benefit do i get by using a resource file instead of a custom xml solution? thanks!
0
by: VigneshS | last post by:
Hi, I am a newbie to Globalization and Localisation Concepts. I tried almost all the methods of the Globalization concepts. But i cannot be able to embed a text file within a Resource. ...
1
by: TisMe | last post by:
Hi All, I am trying to use resource files to globalize my website application. I had this working fine, working through the API for setting page titles programatically, with the resource files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.